summaryrefslogtreecommitdiff
path: root/sysdeps/generic/bits
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-03-22 23:14:50 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-03-22 23:14:50 +0100
commitc9d34d90c7f4c813386edeccf78a7a1ed2300145 (patch)
treef178be51b296e11c086570728fe5344e3d07342e /sysdeps/generic/bits
parentd38e86a6abdc595d398629b50567dbaad5263321 (diff)
Avoid exposing internals of structures
* sysdeps/generic/bits/barrier-attr.h (__pthread_barrierattr): Rename `pshared' field to `__pshared'. * sysdeps/generic/bits/barrier.h (__pthread_barrier): Rename `lock', `'queue', `pending', `count', `attr', and `data' fields to `__lock', `__queue', `__pending', `__count', `__attr', and `__data'. * sysdeps/generic/bits/cancelation.h (__pthread_cancelation_handler): Rename `handler', `arg', and `next' fields to `__handler', `__arg', and `__next'. * sysdeps/generic/bits/condition-attr.h (__pthread_condattr): Rename `pshared' and `clock' fields to `__pshared', and `__clock'. * sysdeps/generic/bits/mutex-attr.h (__pthread_mutexattr): Rename `prioceiling', `protocol', `pshared', and `mutex_type' fields to `__prioceiling', `__protocol', `__pshared', and `__mutex_type'. * sysdeps/generic/bits/mutex.h (__pthread_mutex): Rename `cthreadscompat1', `attr', `data', `owner', and `locks' fields to `__cthreadscompat1', `__attr', `__data', `__owner', and `__locks'. * sysdeps/generic/bits/once.h (__pthread_once): Rename `run' and `lock' fields to `__run' and `__lock'. * sysdeps/generic/bits/rwlock-attr.h (__pthread_rwlockattr): Rename `psharead' field to `__pshared'. * sysdeps/generic/bits/rwlock.h (__pthread_rwlock): Rename `readers', `readerqueue', and `writerqueue' fields to `__readers', `__readerqueue', and `__writerqueue'. * sysdeps/generic/bits/thread-attr.h (__pthread_contentionscope): Rename `schedparam', `stackaddr', `stacksize', `guardsize', `detachstate', `inheritsched', `contentionscope', and `schedpolicy' fields to `__schedparam', `__stackaddr', `__stacksize', `__guardsize', `__detachstate', `__inheritsched', `__contentionscope', and `__schedpolicy''. * sysdeps/generic/bits/cancelation.h: Update code accordingly. * pthread/pt-create.c: Likewise. * pthread/pt-exit.c: Likewise. * pthread/pt-getattr.c: Likewise. * sysdeps/generic/pt-attr-getdetachstate.c: Likewise. * sysdeps/generic/pt-attr-getguardsize.c: Likewise. * sysdeps/generic/pt-attr-getinheritsched.c: Likewise. * sysdeps/generic/pt-attr-getschedparam.c: Likewise. * sysdeps/generic/pt-attr-getschedpolicy.c: Likewise. * sysdeps/generic/pt-attr-getscope.c: Likewise. * sysdeps/generic/pt-attr-getstackaddr.c: Likewise. * sysdeps/generic/pt-attr-getstacksize.c: Likewise. * sysdeps/generic/pt-attr-setdetachstate.c: Likewise. * sysdeps/generic/pt-attr-setguardsize.c: Likewise. * sysdeps/generic/pt-attr-setinheritsched.c: Likewise. * sysdeps/generic/pt-attr-setschedparam.c: Likewise. * sysdeps/generic/pt-attr-setschedpolicy.c: Likewise. * sysdeps/generic/pt-attr-setscope.c: Likewise. * sysdeps/generic/pt-attr-setstackaddr.c: Likewise. * sysdeps/generic/pt-attr-setstacksize.c: Likewise. * sysdeps/generic/pt-attr.c: Likewise. * sysdeps/generic/pt-barrier-init.c: Likewise. * sysdeps/generic/pt-barrier-wait.c: Likewise. * sysdeps/generic/pt-barrier.c: Likewise. * sysdeps/generic/pt-barrierattr-getpshared.c: Likewise. * sysdeps/generic/pt-barrierattr-setpshared.c: Likewise. * sysdeps/generic/pt-cond-timedwait.c: Likewise. * sysdeps/generic/pt-cond.c: Likewise. * sysdeps/generic/pt-condattr-getclock.c: Likewise. * sysdeps/generic/pt-condattr-getpshared.c: Likewise. * sysdeps/generic/pt-condattr-setclock.c: Likewise. * sysdeps/generic/pt-condattr-setpshared.c: Likewise. * sysdeps/generic/pt-mutex-destroy.c: Likewise. * sysdeps/generic/pt-mutex-init.c: Likewise. * sysdeps/generic/pt-mutex-timedlock.c: Likewise. * sysdeps/generic/pt-mutex-transfer-np.c: Likewise. * sysdeps/generic/pt-mutex-trylock.c: Likewise. * sysdeps/generic/pt-mutex-unlock.c: Likewise. * sysdeps/generic/pt-mutexattr-getprotocol.c: Likewise. * sysdeps/generic/pt-mutexattr-getpshared.c: Likewise. * sysdeps/generic/pt-mutexattr-gettype.c: Likewise. * sysdeps/generic/pt-mutexattr-setprotocol.c: Likewise. * sysdeps/generic/pt-mutexattr-setpshared.c: Likewise. * sysdeps/generic/pt-mutexattr-settype.c: Likewise. * sysdeps/generic/pt-mutexattr.c: Likewise. * sysdeps/generic/pt-once.c: Likewise. * sysdeps/generic/pt-rwlock-attr.c: Likewise. * sysdeps/generic/pt-rwlock-timedrdlock.c: Likewise. * sysdeps/generic/pt-rwlock-timedwrlock.c: Likewise. * sysdeps/generic/pt-rwlock-tryrdlock.c: Likewise. * sysdeps/generic/pt-rwlock-trywrlock.c: Likewise. * sysdeps/generic/pt-rwlock-unlock.c: Likewise. * sysdeps/generic/pt-rwlockattr-getpshared.c: Likewise. * sysdeps/generic/pt-rwlockattr-setpshared.c: Likewise. * sysdeps/mach/hurd/pt-attr-setstackaddr.c: Likewise. * sysdeps/mach/hurd/pt-attr-setstacksize.c: Likewise. * sysdeps/mach/hurd/pt-hurd-cond-timedwait.c: Likewise.
Diffstat (limited to 'sysdeps/generic/bits')
-rw-r--r--sysdeps/generic/bits/barrier-attr.h2
-rw-r--r--sysdeps/generic/bits/barrier.h12
-rw-r--r--sysdeps/generic/bits/cancelation.h10
-rw-r--r--sysdeps/generic/bits/condition-attr.h4
-rw-r--r--sysdeps/generic/bits/mutex-attr.h8
-rw-r--r--sysdeps/generic/bits/mutex.h10
-rw-r--r--sysdeps/generic/bits/once.h4
-rw-r--r--sysdeps/generic/bits/rwlock-attr.h2
-rw-r--r--sysdeps/generic/bits/rwlock.h6
-rw-r--r--sysdeps/generic/bits/thread-attr.h16
10 files changed, 37 insertions, 37 deletions
diff --git a/sysdeps/generic/bits/barrier-attr.h b/sysdeps/generic/bits/barrier-attr.h
index a9900b7..7734069 100644
--- a/sysdeps/generic/bits/barrier-attr.h
+++ b/sysdeps/generic/bits/barrier-attr.h
@@ -26,7 +26,7 @@ enum __pthread_process_shared;
Note that not all of them are supported on all systems. */
struct __pthread_barrierattr
{
- enum __pthread_process_shared pshared;
+ enum __pthread_process_shared __pshared;
};
#endif /* bits/barrier-attr.h */
diff --git a/sysdeps/generic/bits/barrier.h b/sysdeps/generic/bits/barrier.h
index 5e55931..dabe86f 100644
--- a/sysdeps/generic/bits/barrier.h
+++ b/sysdeps/generic/bits/barrier.h
@@ -25,14 +25,14 @@
/* This structure describes the attributes of a POSIX barrier. */
struct __pthread_barrier
{
- __pthread_spinlock_t lock;
- struct __pthread *queue; /* List of waiters. */
- unsigned pending; /* Number of that still need to wait on
+ __pthread_spinlock_t __lock;
+ struct __pthread *__queue; /* List of waiters. */
+ unsigned __pending; /* Number of that still need to wait on
barrier. */
- unsigned count; /* Number of threads that must wait before
+ unsigned __count; /* Number of threads that must wait before
barrier is passed. */
- struct __pthread_barrierattr *attr;
- void *data;
+ struct __pthread_barrierattr *__attr;
+ void *__data;
};
diff --git a/sysdeps/generic/bits/cancelation.h b/sysdeps/generic/bits/cancelation.h
index 46486f5..1ed16c6 100644
--- a/sysdeps/generic/bits/cancelation.h
+++ b/sysdeps/generic/bits/cancelation.h
@@ -22,9 +22,9 @@
struct __pthread_cancelation_handler
{
- void (*handler)(void *);
- void *arg;
- struct __pthread_cancelation_handler *next;
+ void (*__handler)(void *);
+ void *__arg;
+ struct __pthread_cancelation_handler *__next;
};
/* Returns the thread local location of the cleanup handler stack. */
@@ -44,8 +44,8 @@ struct __pthread_cancelation_handler **__pthread_get_cleanup_stack (void);
#define __pthread_cleanup_pop(execute) \
if (execute) \
- __handler.handler (__handler.arg); \
- *__handlers = __handler.next; \
+ __handler.__handler (__handler.__arg); \
+ *__handlers = __handler.__next; \
}
#endif /* _BITS_CANCELATION_H */
diff --git a/sysdeps/generic/bits/condition-attr.h b/sysdeps/generic/bits/condition-attr.h
index 4cd4e8c..19c92bb 100644
--- a/sysdeps/generic/bits/condition-attr.h
+++ b/sysdeps/generic/bits/condition-attr.h
@@ -27,8 +27,8 @@ enum __pthread_process_shared;
/* User visible part of a condition attribute variable. */
struct __pthread_condattr
{
- enum __pthread_process_shared pshared;
- __clockid_t clock;
+ enum __pthread_process_shared __pshared;
+ __clockid_t __clock;
};
#endif /* bits/condition.h */
diff --git a/sysdeps/generic/bits/mutex-attr.h b/sysdeps/generic/bits/mutex-attr.h
index 8514ebe..f3d0752 100644
--- a/sysdeps/generic/bits/mutex-attr.h
+++ b/sysdeps/generic/bits/mutex-attr.h
@@ -28,10 +28,10 @@ enum __pthread_mutex_type;
attribute. */
struct __pthread_mutexattr
{
- int prioceiling;
- enum __pthread_mutex_protocol protocol;
- enum __pthread_process_shared pshared;
- enum __pthread_mutex_type mutex_type;
+ int __prioceiling;
+ enum __pthread_mutex_protocol __protocol;
+ enum __pthread_process_shared __pshared;
+ enum __pthread_mutex_type __mutex_type;
};
/* Attributes for a recursive mutex. */
diff --git a/sysdeps/generic/bits/mutex.h b/sysdeps/generic/bits/mutex.h
index c734c39..3120237 100644
--- a/sysdeps/generic/bits/mutex.h
+++ b/sysdeps/generic/bits/mutex.h
@@ -41,14 +41,14 @@ struct __pthread_mutex
__pthread_spinlock_t __lock;
/* In cthreads, mutex_init does not initialized thre third
pointer, as such, we cannot rely on its value for anything. */
- char *cthreadscompat1;
+ char *__cthreadscompat1;
struct __pthread *__queue;
- struct __pthread_mutexattr *attr;
- void *data;
+ struct __pthread_mutexattr *__attr;
+ void *__data;
/* Up to this point, we are completely compatible with cthreads
and what libc expects. */
- void *owner;
- unsigned locks;
+ void *__owner;
+ unsigned __locks;
/* If NULL then the default attributes apply. */
};
diff --git a/sysdeps/generic/bits/once.h b/sysdeps/generic/bits/once.h
index f4985d6..05895b9 100644
--- a/sysdeps/generic/bits/once.h
+++ b/sysdeps/generic/bits/once.h
@@ -24,8 +24,8 @@
struct __pthread_once
{
- int run;
- __pthread_spinlock_t lock;
+ int __run;
+ __pthread_spinlock_t __lock;
};
#define __PTHREAD_ONCE_INIT \
diff --git a/sysdeps/generic/bits/rwlock-attr.h b/sysdeps/generic/bits/rwlock-attr.h
index dba99f1..e78b91e 100644
--- a/sysdeps/generic/bits/rwlock-attr.h
+++ b/sysdeps/generic/bits/rwlock-attr.h
@@ -26,7 +26,7 @@ enum __pthread_process_shared;
Note that not all of them are supported on all systems. */
struct __pthread_rwlockattr
{
- enum __pthread_process_shared pshared;
+ enum __pthread_process_shared __pshared;
};
#endif /* bits/rwlock-attr.h */
diff --git a/sysdeps/generic/bits/rwlock.h b/sysdeps/generic/bits/rwlock.h
index af6b1c8..bc27726 100644
--- a/sysdeps/generic/bits/rwlock.h
+++ b/sysdeps/generic/bits/rwlock.h
@@ -31,9 +31,9 @@ struct __pthread_rwlock
{
__pthread_spinlock_t __held;
__pthread_spinlock_t __lock;
- int readers;
- struct __pthread *readerqueue;
- struct __pthread *writerqueue;
+ int __readers;
+ struct __pthread *__readerqueue;
+ struct __pthread *__writerqueue;
struct __pthread_rwlockattr *__attr;
void *__data;
};
diff --git a/sysdeps/generic/bits/thread-attr.h b/sysdeps/generic/bits/thread-attr.h
index 9a8fb75..d9456b0 100644
--- a/sysdeps/generic/bits/thread-attr.h
+++ b/sysdeps/generic/bits/thread-attr.h
@@ -34,14 +34,14 @@ enum __pthread_contentionscope;
that not all of them are supported on all systems. */
struct __pthread_attr
{
- struct __sched_param schedparam;
- void *stackaddr;
- size_t stacksize;
- size_t guardsize;
- enum __pthread_detachstate detachstate;
- enum __pthread_inheritsched inheritsched;
- enum __pthread_contentionscope contentionscope;
- int schedpolicy;
+ struct __sched_param __schedparam;
+ void *__stackaddr;
+ size_t __stacksize;
+ size_t __guardsize;
+ enum __pthread_detachstate __detachstate;
+ enum __pthread_inheritsched __inheritsched;
+ enum __pthread_contentionscope __contentionscope;
+ int __schedpolicy;
};
#endif /* bits/thread-attr.h */