diff options
-rw-r--r-- | Versions | 1 | ||||
-rw-r--r-- | include/pthread/pthread.h | 266 | ||||
-rw-r--r-- | libpthread.a | 1 | ||||
-rw-r--r-- | libpthread_pic.a | 1 | ||||
-rw-r--r-- | pthread/cthreads-compat.c | 6 | ||||
-rw-r--r-- | sysdeps/generic/raise.c | 21 | ||||
-rw-r--r-- | sysdeps/hurd/pt-kill.c | 5 | ||||
-rw-r--r-- | sysdeps/mach/hurd/bits/pthread-np.h | 2 | ||||
-rw-r--r-- | sysdeps/pthread/bits/semaphore.h | 3 | ||||
-rw-r--r-- | sysdeps/pthread/semaphore.h (renamed from include/semaphore.h) | 0 |
10 files changed, 150 insertions, 156 deletions
@@ -44,7 +44,6 @@ libpthread { cthread_fork; cthread_keycreate; cthread_getspecific; - __libc_getspecific; cthread_setspecific; __mutex_lock_solid; __mutex_unlock_solid; diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h index cd32fb2..f0d080a 100644 --- a/include/pthread/pthread.h +++ b/include/pthread/pthread.h @@ -79,112 +79,112 @@ __BEGIN_DECLS /* Initialize the thread attribute object in *ATTR to the default values. */ -extern int pthread_attr_init (pthread_attr_t *attr); +extern int pthread_attr_init (pthread_attr_t *__attr); /* Destroy the thread attribute object in *ATTR. */ -extern int pthread_attr_destroy (pthread_attr_t *attr); +extern int pthread_attr_destroy (pthread_attr_t *__attr); /* Return the value of the inheritsched attribute in *ATTR in *INHERITSCHED. */ -extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict attr, - int *__restrict inheritsched); +extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, + int *__restrict __inheritsched); /* Set the value of the inheritsched attribute in *ATTR to INHERITSCHED. */ -extern int pthread_attr_setinheritsched (pthread_attr_t *attr, - int inheritsched); +extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inheritsched); /* Return the value of the schedparam attribute in *ATTR in *PARAM. */ -extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict attr, - struct sched_param *__restrict param); +extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, + struct sched_param *__restrict __param); /* Set the value of the schedparam attribute in *ATTR to PARAM. */ -extern int pthread_attr_setschedparam (pthread_attr_t *__restrict attr, - const struct sched_param *__restrict param); +extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, + const struct sched_param *__restrict __param); /* Return the value of the schedpolicy attribute in *ATTR to *POLICY. */ -extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict attr, - int *__restrict policy); +extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, + int *__restrict __policy); /* Set the value of the schedpolicy attribute in *ATTR to POLICY. */ -extern int pthread_attr_setschedpolicy (pthread_attr_t *attr, - int policy); +extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, + int __policy); /* Return the value of the contentionscope attribute in *ATTR in *CONTENTIONSCOPE. */ -extern int pthread_attr_getscope (const pthread_attr_t *__restrict attr, - int *__restrict contentionscope); +extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, + int *__restrict __contentionscope); /* Set the value of the contentionscope attribute in *ATTR to CONTENTIONSCOPE. */ -extern int pthread_attr_setscope (pthread_attr_t *attr, - int contentionscope); +extern int pthread_attr_setscope (pthread_attr_t *__attr, + int __contentionscope); /* Return the value of the stackaddr attribute in *ATTR in *STACKADDR. */ -extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict attr, - void **__restrict stackaddr); +extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr); /* Set the value of the stackaddr attribute in *ATTR to STACKADDR. */ -extern int pthread_attr_setstackaddr (pthread_attr_t *attr, - void *stackaddr); +extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, + void *__stackaddr); #ifdef __USE_XOPEN2K /* Return the value of the stackaddr and stacksize attributes in *ATTR in *STACKADDR and *STACKSIZE respectively. */ -extern int pthread_attr_getstack (const pthread_attr_t *__restrict attr, - void **__restrict stackaddr, - size_t *__restrict stacksize); +extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr, + size_t *__restrict __stacksize); /* Set the value of the stackaddr and stacksize attributes in *ATTR to STACKADDR and STACKSIZE respectively. */ -extern int pthread_attr_setstack (pthread_attr_t *attr, - void *stackaddr, - size_t stacksize); +extern int pthread_attr_setstack (pthread_attr_t *__attr, + void *__stackaddr, + size_t __stacksize); #endif /* Return the value of the detachstate attribute in *ATTR in *DETACHSTATE. */ -extern int pthread_attr_getdetachstate (const pthread_attr_t *attr, - int *detachstate); +extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, + int *__detachstate); /* Set the value of the detachstate attribute in *ATTR to DETACHSTATE. */ -extern int pthread_attr_setdetachstate (pthread_attr_t *attr, - int detachstate); +extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, + int __detachstate); /* Return the value of the guardsize attribute in *ATTR in *GUARDSIZE. */ -extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict attr, - size_t *__restrict guardsize); +extern int pthread_attr_getguardsize (const pthread_attr_t *__restrict __attr, + size_t *__restrict __guardsize); /* Set the value of the guardsize attribute in *ATTR to GUARDSIZE. */ -extern int pthread_attr_setguardsize (pthread_attr_t *attr, - size_t guardsize); +extern int pthread_attr_setguardsize (pthread_attr_t *__attr, + size_t __guardsize); /* Return the value of the stacksize attribute in *ATTR in *STACKSIZE. */ -extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict attr, - size_t *__restrict stacksize); +extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, + size_t *__restrict __stacksize); /* Set the value of the stacksize attribute in *ATTR to STACKSIZE. */ -extern int pthread_attr_setstacksize (pthread_attr_t *attr, - size_t stacksize); +extern int pthread_attr_setstacksize (pthread_attr_t *__attr, + size_t __stacksize); #ifdef __USE_GNU /* Initialize thread attribute *ATTR with attributes corresponding to the already running thread THREAD. It shall be called on an uninitialized ATTR and destroyed with pthread_attr_destroy when no longer needed. */ -extern int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr); +extern int pthread_getattr_np (pthread_t __thr, pthread_attr_t *__attr); #endif @@ -197,7 +197,7 @@ extern int pthread_create (pthread_t *__restrict __threadp, /* Terminate the current thread and make STATUS available to any thread that might join us. */ -extern void pthread_exit (void *__status) __attribute__ ((noreturn)); +extern void pthread_exit (void *__status) __attribute__ ((__noreturn__)); /* Make calling thread wait for termination of thread THREAD. Return the exit status of the thread in *STATUS. */ @@ -255,54 +255,54 @@ extern pthread_t pthread_self (void); /* Initialize the mutex attribute object in *ATTR to the default values. */ -extern int pthread_mutexattr_init(pthread_mutexattr_t *attr); +extern int pthread_mutexattr_init(pthread_mutexattr_t *__attr); /* Destroy the mutex attribute structure in *ATTR. */ -extern int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); +extern int pthread_mutexattr_destroy(pthread_mutexattr_t *__attr); #ifdef __USE_UNIX98 /* Return the value of the prioceiling attribute in *ATTR in *PRIOCEILING. */ -extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict attr, - int *__restrict prioceiling); +extern int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __prioceiling); /* Set the value of the prioceiling attribute in *ATTR to PRIOCEILING. */ -extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, - int prioceiling); +extern int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *__attr, + int __prioceiling); /* Return the value of the protocol attribute in *ATTR in *PROTOCOL. */ -extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict attr, - int *__restrict protocol); +extern int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __protocol); /* Set the value of the protocol attribute in *ATTR to PROTOCOL. */ -extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, - int protocol); +extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *__attr, + int __protocol); #endif /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_mutexattr_getpshared(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared attribute in *ATTR to PSHARED. */ -extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, - int pshared); +extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *__attr, + int __pshared); #if defined __USE_UNIX98 || defined __USE_XOPEN2K8 /* Return the value of the type attribute in *ATTR in *TYPE. */ -extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict attr, - int *__restrict type); +extern int pthread_mutexattr_gettype(const pthread_mutexattr_t *__restrict __attr, + int *__restrict __type); /* Set the value of the type attribute in *ATTR to TYPE. */ -extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, - int type); +extern int pthread_mutexattr_settype(pthread_mutexattr_t *__attr, + int __type); #endif @@ -323,7 +323,7 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, /* Create a mutex with attributes given by ATTR and store it in *__MUTEX. */ extern int pthread_mutex_init (struct __pthread_mutex *__restrict __mutex, - const pthread_mutexattr_t *__restrict attr); + const pthread_mutexattr_t *__restrict __attr); /* Destroy the mutex __MUTEX. */ extern int pthread_mutex_destroy (struct __pthread_mutex *__mutex); @@ -336,8 +336,8 @@ extern int pthread_mutex_trylock (pthread_mutex_t *__mutex); #ifdef __USE_XOPEN2K /* Try to lock MUTEX, block until *ABSTIME if it is already held. */ -extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict mutex, - const struct timespec *__restrict abstime); +extern int pthread_mutex_timedlock (struct __pthread_mutex *__restrict __mutex, + const struct timespec *__restrict __abstime); #endif /* Unlock MUTEX. */ @@ -345,20 +345,20 @@ extern int pthread_mutex_unlock (pthread_mutex_t *__mutex); /* Transfer ownership of the mutex MUTEX to the thread TID. The caller must own the lock. */ -extern int __pthread_mutex_transfer_np (struct __pthread_mutex *mutex, - pthread_t tid); +extern int __pthread_mutex_transfer_np (struct __pthread_mutex *__mutex, + pthread_t __tid); #ifdef __USE_UNIX98 /* Return the priority ceiling of mutex *MUTEX in *PRIOCEILING. */ -extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict mutex, - int *__restrict prioceiling); +extern int pthread_mutex_getprioceiling (const pthread_mutex_t *__restrict __mutex, + int *__restrict __prioceiling); /* After acquiring the mutex *MUTEX, set its priority ceiling to PRIO and return the old priority ceiling in *OLDPRIO. Before returning, release the mutex. */ -extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict mutex, - int prio, int *__restrict oldprio); +extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, + int __prio, int *__restrict __oldprio); #endif @@ -369,32 +369,32 @@ extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict mutex, /* Initialize the condition attribute in *ATTR to the default values. */ -extern int pthread_condattr_init (pthread_condattr_t *attr); +extern int pthread_condattr_init (pthread_condattr_t *__attr); /* Destroy the condition attribute structure in *ATTR. */ -extern int pthread_condattr_destroy (pthread_condattr_t *attr); +extern int pthread_condattr_destroy (pthread_condattr_t *__attr); #ifdef __USE_XOPEN2K /* Return the value of the clock attribute in *ATTR in *CLOCK_ID. */ -extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict attr, - __clockid_t *__restrict clock_id); +extern int pthread_condattr_getclock (const pthread_condattr_t *__restrict __attr, + __clockid_t *__restrict __clock_id); /* Set the value of the clock attribute in *ATTR to CLOCK_ID. */ -extern int pthread_condattr_setclock (pthread_condattr_t *attr, - __clockid_t clock_id); +extern int pthread_condattr_setclock (pthread_condattr_t *__attr, + __clockid_t __clock_id); #endif /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_condattr_getpshared (const pthread_condattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared attribute in *ATTR to PSHARED. */ -extern int pthread_condattr_setpshared (pthread_condattr_t *attr, - int pshared); +extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, + int __pshared); /* Condition variables. */ @@ -403,10 +403,10 @@ extern int pthread_condattr_setpshared (pthread_condattr_t *attr, #define PTHREAD_COND_INITIALIZER __PTHREAD_COND_INITIALIZER -extern int pthread_cond_init (pthread_cond_t *__restrict cond, - const pthread_condattr_t *__restrict attr); +extern int pthread_cond_init (pthread_cond_t *__restrict __cond, + const pthread_condattr_t *__restrict __attr); -extern int pthread_cond_destroy (pthread_cond_t *cond); +extern int pthread_cond_destroy (pthread_cond_t *__cond); /* Unblock at least one of the threads that are blocked on condition variable COND. */ @@ -503,21 +503,21 @@ pthread_spin_unlock (pthread_spinlock_t *__lock) /* Initialize rwlock attribute object in *ATTR to the default values. */ -extern int pthread_rwlockattr_init (pthread_rwlockattr_t *attr); +extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr); /* Destroy the rwlock attribute object in *ATTR. */ -extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr); +extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr); /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared atrribute in *ATTR to PSHARED. */ -extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, - int pshared); +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared); /* rwlocks. */ @@ -527,40 +527,40 @@ extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, #define PTHREAD_RWLOCK_INITIALIZER __PTHREAD_RWLOCK_INITIALIZER /* Create a rwlock object with attributes given by ATTR and strore the result in *RWLOCK. */ -extern int pthread_rwlock_init (pthread_rwlock_t *__restrict rwlock, - const pthread_rwlockattr_t *__restrict attr); +extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, + const pthread_rwlockattr_t *__restrict __attr); /* Destroy the rwlock *RWLOCK. */ -extern int pthread_rwlock_destroy (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock); /* Acquire the rwlock *RWLOCK for reading. */ -extern int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock); /* Acquire the rwlock *RWLOCK for reading. */ -extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock); # ifdef __USE_XOPEN2K /* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if it is already held. */ -extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict rwlock, - const struct timespec *__restrict abstime); +extern int pthread_rwlock_timedrdlock (struct __pthread_rwlock *__restrict __rwlock, + const struct timespec *__restrict __abstime); # endif /* Acquire the rwlock *RWLOCK for writing. */ -extern int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock); /* Try to acquire the rwlock *RWLOCK for writing. */ -extern int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); # ifdef __USE_XOPEN2K /* Acquire the rwlock *RWLOCK for writing blocking until *ABSTIME if it is already held. */ -extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict rwlock, - const struct timespec *__restrict abstime); +extern int pthread_rwlock_timedwrlock (struct __pthread_rwlock *__restrict __rwlock, + const struct timespec *__restrict __abstime); # endif /* Release the lock held by the current thread on *RWLOCK. */ -extern int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock); #endif /* __USE_UNIX98 || __USE_XOPEN2K */ @@ -569,10 +569,10 @@ extern int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); /* Cancelation. */ /* Register a cleanup handler. */ -extern void pthread_cleanup_push (void (*routine) (void *), void *arg); +extern void pthread_cleanup_push (void (*__routine) (void *), void *__arg); /* Unregister a cleanup handler. */ -extern void pthread_cleanup_pop (int execute); +extern void pthread_cleanup_pop (int __execute); #include <bits/cancelation.h> @@ -584,21 +584,21 @@ extern void pthread_cleanup_pop (int execute); /* Return the calling thread's cancelation state in *OLDSTATE and set its state to STATE. */ -extern int pthread_setcancelstate (int state, int *oldstate); +extern int pthread_setcancelstate (int __state, int *__oldstate); #define PTHREAD_CANCEL_DEFERRED 0 #define PTHREAD_CANCEL_ASYNCHRONOUS 1 /* Return the calling thread's cancelation type in *OLDTYPE and set its type to TYPE. */ -extern int pthread_setcanceltype (int type, int *oldtype); +extern int pthread_setcanceltype (int __type, int *__oldtype); /* Value returned by pthread_join if the target thread was canceled. */ #define PTHREAD_CANCELED ((void *) -1) /* Cancel THEAD. */ -extern int pthread_cancel (pthread_t thread); +extern int pthread_cancel (pthread_t __thr); /* Add an explicit cancelation point. */ extern void pthread_testcancel (void); @@ -612,21 +612,21 @@ extern void pthread_testcancel (void); /* Initialize barrier attribute object in *ATTR to the default values. */ -extern int pthread_barrierattr_init (pthread_barrierattr_t *attr); +extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr); /* Destroy the barrier attribute object in *ATTR. */ -extern int pthread_barrierattr_destroy (pthread_barrierattr_t *attr); +extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr); /* Return the value of the process shared attribute in *ATTR in *PSHARED. */ -extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict attr, - int *__restrict pshared); +extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t *__restrict __attr, + int *__restrict __pshared); /* Set the value of the process shared atrribute in *ATTR to PSHARED. */ -extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, - int pshared); +extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared); /* Barriers. */ @@ -638,15 +638,15 @@ extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, #define PTHREAD_BARRIER_SERIAL_THREAD -1 /* Initialize barrier BARRIER. */ -extern int pthread_barrier_init (pthread_barrier_t *__restrict barrier, - const pthread_barrierattr_t *__restrict attr, - unsigned count); +extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, + const pthread_barrierattr_t *__restrict __attr, + unsigned __count); /* Destroy barrier BARRIER. */ -extern int pthread_barrier_destroy (pthread_barrier_t *barrier); +extern int pthread_barrier_destroy (pthread_barrier_t *__barrier); /* Wait on barrier BARRIER. */ -extern int pthread_barrier_wait (pthread_barrier_t *barrier); +extern int pthread_barrier_wait (pthread_barrier_t *__barrier); #endif /* __USE_XOPEN2K */ @@ -659,18 +659,18 @@ extern int pthread_barrier_wait (pthread_barrier_t *barrier); /* Create a thread specific data key in KEY visible to all threads. On thread destruction, DESTRUCTOR shall be called with the thread specific data associate with KEY if it is not NULL. */ -extern int pthread_key_create (pthread_key_t *key, - void (*destructor) (void *)); +extern int pthread_key_create (pthread_key_t *__key, + void (*__destructor) (void *)); /* Delete the thread specific data key KEY. The associated destructor function is not called. */ -extern int pthread_key_delete (pthread_key_t key); +extern int pthread_key_delete (pthread_key_t __key); /* Return the caller thread's thread specific value of KEY. */ -extern void *pthread_getspecific (pthread_key_t key); +extern void *pthread_getspecific (pthread_key_t __key); /* Set the caller thread's thread specific value of KEY to VALUE. */ -extern int pthread_setspecific (pthread_key_t key, const void *value); +extern int pthread_setspecific (pthread_key_t __key, const void *__value); /* Dynamic package initialization. */ @@ -681,15 +681,15 @@ extern int pthread_setspecific (pthread_key_t key, const void *value); /* Call INIT_ROUTINE if this function has never been called with *ONCE_CONTROL, otherwise do nothing. */ -extern int pthread_once (pthread_once_t *once_control, - void (*init_routine) (void)); +extern int pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)); /* Concurrency. */ #ifdef __USE_UNIX98 /* Set the desired concurrency level to NEW_LEVEL. */ -extern int pthread_setconcurrency (int new_level); +extern int pthread_setconcurrency (int __new_level); /* Get the current concurrency level. */ extern int pthread_getconcurrency (void); @@ -705,36 +705,36 @@ extern int pthread_getconcurrency (void); NULL. The prepare handles will be called in the reverse order which they were registered and the parent and child handlers in the order in which they were registered. */ -extern int pthread_atfork (void (*prepare) (void), void (*parent) (void), - void (*child) (void)); +extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), + void (*__child) (void)); /* Signals (should be in <signal.h>). */ /* Send signal SIGNO to thread THREAD. */ -extern int pthread_kill (pthread_t thread, int signo); +extern int pthread_kill (pthread_t __thr, int __signo); /* Time. */ #ifdef __USE_XOPEN2K /* Return the thread cpu clock. */ -extern int pthread_getcpuclockid (pthread_t thread, __clockid_t *clock); +extern int pthread_getcpuclockid (pthread_t __thr, __clockid_t *__clock); #endif /* Scheduling. */ /* Return thread THREAD's scheduling paramters. */ -extern int pthread_getschedparam (pthread_t thread, int *__restrict policy, - struct sched_param *__restrict param); +extern int pthread_getschedparam (pthread_t __thr, int *__restrict __policy, + struct sched_param *__restrict __param); /* Set thread THREAD's scheduling paramters. */ -extern int pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param); +extern int pthread_setschedparam (pthread_t __thr, int __policy, + const struct sched_param *__param); /* Set thread THREAD's scheduling priority. */ -extern int pthread_setschedprio (pthread_t thread, int prio); +extern int pthread_setschedprio (pthread_t __thr, int __prio); #ifdef __USE_GNU /* Yield the processor to another thread or process. diff --git a/libpthread.a b/libpthread.a index a87be26..7d3f8d3 100644 --- a/libpthread.a +++ b/libpthread.a @@ -8,7 +8,6 @@ EXTERN(cthread_detach) EXTERN(cthread_fork) EXTERN(cthread_keycreate) EXTERN(cthread_getspecific) -EXTERN(__libc_getspecific) EXTERN(cthread_setspecific) EXTERN(__mutex_lock_solid) EXTERN(__mutex_unlock_solid) diff --git a/libpthread_pic.a b/libpthread_pic.a index 85d5231..cf0bd90 100644 --- a/libpthread_pic.a +++ b/libpthread_pic.a @@ -8,7 +8,6 @@ EXTERN(cthread_detach) EXTERN(cthread_fork) EXTERN(cthread_keycreate) EXTERN(cthread_getspecific) -EXTERN(__libc_getspecific) EXTERN(cthread_setspecific) EXTERN(__mutex_lock_solid) EXTERN(__mutex_unlock_solid) diff --git a/pthread/cthreads-compat.c b/pthread/cthreads-compat.c index cbe8170..1a0971b 100644 --- a/pthread/cthreads-compat.c +++ b/pthread/cthreads-compat.c @@ -70,12 +70,6 @@ cthread_getspecific (cthread_key_t key, void **val) return 0; } -void * -__libc_getspecific (cthread_key_t key) -{ - return pthread_getspecific (key); -} - int cthread_setspecific (cthread_key_t key, void *val) { diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 15348ce..3c497da 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -19,6 +19,8 @@ <http://www.gnu.org/licenses/>. */ #include <pthread.h> +#include <signal.h> +#include <unistd.h> #pragma weak pthread_kill #pragma weak pthread_self @@ -29,17 +31,18 @@ raise (int signo) "the effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig);" */ - int err; if (pthread_kill) - err = pthread_kill (pthread_self (), signo); - else - err = __kill (__getpid (), signo); - if (err) { - errno = err; - return -1; + int err; + err = pthread_kill (pthread_self (), signo); + if (err) + { + errno = err; + return -1; + } + return 0; } - - return 0; + else + return __kill (__getpid (), signo); } diff --git a/sysdeps/hurd/pt-kill.c b/sysdeps/hurd/pt-kill.c index d204e3f..49dfd7d 100644 --- a/sysdeps/hurd/pt-kill.c +++ b/sysdeps/hurd/pt-kill.c @@ -46,7 +46,6 @@ pthread_kill (pthread_t thread, int sig) detail.code = sig; detail.error = 0; - _hurd_raise_signal (ss, sig, &detail); - - return 0; + __spin_lock (&ss->lock); + return _hurd_raise_signal (ss, sig, &detail); } diff --git a/sysdeps/mach/hurd/bits/pthread-np.h b/sysdeps/mach/hurd/bits/pthread-np.h index 5f75e06..4487ffd 100644 --- a/sysdeps/mach/hurd/bits/pthread-np.h +++ b/sysdeps/mach/hurd/bits/pthread-np.h @@ -33,6 +33,6 @@ extern int pthread_hurd_cond_wait_np (pthread_cond_t *__restrict __cond, See hurd_thread_cancel. */ extern int pthread_hurd_cond_timedwait_np (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, - const struct timespec *abstime); + const struct timespec *__abstime); #endif /* bits/pthread-np.h */ diff --git a/sysdeps/pthread/bits/semaphore.h b/sysdeps/pthread/bits/semaphore.h index 5e987c1..4c78409 100644 --- a/sysdeps/pthread/bits/semaphore.h +++ b/sysdeps/pthread/bits/semaphore.h @@ -24,7 +24,8 @@ #error Never include <bits/semaphore.h> directly. #endif -#include <pthread.h> +#include <bits/spin-lock.h> +#include <bits/pthread.h> /* User visible part of a semaphore. */ struct __semaphore diff --git a/include/semaphore.h b/sysdeps/pthread/semaphore.h index 64249f6..64249f6 100644 --- a/include/semaphore.h +++ b/sysdeps/pthread/semaphore.h |