diff options
author | Thomas Pfaff <tpfaff@gmx.net> | 2003-03-18 20:12:05 +0000 |
---|---|---|
committer | Thomas Pfaff <tpfaff@gmx.net> | 2003-03-18 20:12:05 +0000 |
commit | 6a80a133be504d45b099f51330a5a5f65191db8d (patch) | |
tree | ff4ab7e34a79264b72cd978e72791276f5056edb /winsup/cygwin | |
parent | 4fd9bca85e390cbb98fe232a8405df7db6eafb51 (diff) | |
download | newlib-6a80a133be504d45b099f51330a5a5f65191db8d.zip newlib-6a80a133be504d45b099f51330a5a5f65191db8d.tar.gz newlib-6a80a133be504d45b099f51330a5a5f65191db8d.tar.bz2 |
* pthread.cc (pthread_attr_init): Remove
(pthread_attr_destroy): Ditto.
(pthread_attr_setdetachstate): Ditto.
(pthread_attr_getdetachstate): Ditto.
(pthread_attr_setstacksize): Ditto.
(pthread_attr_getstacksize): Ditto.
(pthread_attr_setinheritsched): Ditto.
(pthread_attr_getinheritsched): Ditto.
(pthread_attr_setschedparam): Ditto.
(pthread_attr_getschedparam): Ditto.
(pthread_attr_setschedpolicy): Ditto.
(pthread_attr_getschedpolicy): Ditto.
(pthread_attr_setscope): Ditto.
(pthread_attr_getscope): Ditto.
(pthread_attr_setstackaddr): Ditto.
(pthread_attr_getstackaddr): Ditto.
(pthread_key_create): Ditto.
(pthread_key_delete): Ditto.
(pthread_setspecific): Ditto.
(pthread_getspecific): Ditto.
(pthread_kill): Ditto.
(pthread_sigmask): Ditto.
(pthread_equal): Ditto.
(pthread_mutex_lock): Ditto.
(pthread_mutex_trylock): Ditto.
(pthread_mutex_unlock): Ditto.
(pthread_mutex_destroy): Ditto.
(pthread_mutex_setprioceiling): Ditto.
(pthread_mutex_getprioceiling): Ditto.
(pthread_mutexattr_destroy): Ditto.
(pthread_mutexattr_getprioceiling): Ditto.
(pthread_mutexattr_getprotocol): Ditto.
(pthread_mutexattr_getpshared): Ditto.
(pthread_mutexattr_gettype): Ditto.
(pthread_mutexattr_init): Ditto.
(pthread_mutexattr_setprioceiling): Ditto.
(pthread_mutexattr_setprotocol): Ditto.
(pthread_mutexattr_setpshared): Ditto.
(pthread_mutexattr_settype): Ditto.
(pthread_cond_destroy): Ditto.
(pthread_cond_signal): Ditto.
(pthread_cond_broadcast): Ditto.
(pthread_condattr_init): Ditto.
(pthread_condattr_destroy): Ditto.
(pthread_condattr_getpshared): Ditto.
(pthread_condattr_setpshared): Ditto.
(pthread_rwlock_destroy): Ditto.
(pthread_rwlock_rdlock): Ditto.
(pthread_rwlock_tryrdlock): Ditto.
(pthread_rwlock_wrlock): Ditto.
(pthread_rwlock_trywrlock): Ditto.
(pthread_rwlock_unlock): Ditto.
(pthread_rwlockattr_init): Ditto.
(pthread_rwlockattr_getpshared): Ditto.
(pthread_rwlockattr_setpshared): Ditto.
(pthread_rwlockattr_destroy): Ditto.
(pthread_getconcurrency): Ditto.
(pthread_setconcurrency): Ditto.
(pthread_getschedparam): Ditto.
(pthread_setschedparam): Ditto.
* thread.h (__pthread_attr_init): Remove prototype.
(__pthread_attr_destroy): Ditto.
(__pthread_attr_setdetachstate): Ditto.
(__pthread_attr_getdetachstate): Ditto.
(__pthread_attr_setstacksize): Ditto.
(__pthread_attr_getstacksize): Ditto.
(__pthread_attr_setinheritsched): Ditto.
(__pthread_attr_getinheritsched): Ditto.
(__pthread_attr_setschedparam): Ditto.
(__pthread_attr_getschedparam): Ditto.
(__pthread_attr_setschedpolicy): Ditto.
(__pthread_attr_getschedpolicy): Ditto.
(__pthread_attr_setscope): Ditto.
(__pthread_attr_getscope): Ditto.
(__pthread_attr_setstackaddr): Ditto.
(__pthread_attr_getstackaddr): Ditto.
(__pthread_key_create): Ditto.
(__pthread_key_delete): Ditto.
(__pthread_setspecific): Ditto.
(__pthread_getspecific): Ditto.
(__pthread_kill): Ditto.
(__pthread_sigmask): Ditto.
(__pthread_equal): Ditto.
(__pthread_mutex_lock): Ditto.
(__pthread_mutex_trylock): Ditto.
(__pthread_mutex_unlock): Ditto.
(__pthread_mutex_destroy): Ditto.
(__pthread_mutex_setprioceiling): Ditto.
(__pthread_mutex_getprioceiling): Ditto.
(__pthread_mutexattr_destroy): Ditto.
(__pthread_mutexattr_getprioceiling): Ditto.
(__pthread_mutexattr_getprotocol): Ditto.
(__pthread_mutexattr_getpshared): Ditto.
(__pthread_mutexattr_gettype): Ditto.
(__pthread_mutexattr_init): Ditto.
(__pthread_mutexattr_setprioceiling): Ditto.
(__pthread_mutexattr_setprotocol): Ditto.
(__pthread_mutexattr_setpshared): Ditto.
(__pthread_mutexattr_settype): Ditto.
(__pthread_cond_destroy): Ditto.
(__pthread_cond_signal): Ditto.
(__pthread_cond_broadcast): Ditto.
(__pthread_condattr_init): Ditto.
(__pthread_condattr_destroy): Ditto.
(__pthread_condattr_getpshared): Ditto.
(__pthread_condattr_setpshared): Ditto.
(__pthread_rwlock_destroy): Ditto.
(__pthread_rwlock_rdlock): Ditto.
(__pthread_rwlock_tryrdlock): Ditto.
(__pthread_rwlock_wrlock): Ditto.
(__pthread_rwlock_trywrlock): Ditto.
(__pthread_rwlock_unlock): Ditto.
(__pthread_rwlockattr_init): Ditto.
(__pthread_rwlockattr_getpshared): Ditto.
(__pthread_rwlockattr_setpshared): Ditto.
(__pthread_rwlockattr_destroy): Ditto.
(__pthread_getconcurrency): Ditto.
(__pthread_setconcurrency): Ditto.
(__pthread_getschedparam): Ditto.
(__pthread_setschedparam): Ditto.
* thread.cc: Rename __pthread_equal to pthread_equal throughout.
Change pthread_self parameter appropriate.
(__pthread_attr_init): Remove __ prefix. Change to extern "C".
(__pthread_attr_destroy): Ditto.
(__pthread_attr_setdetachstate): Ditto.
(__pthread_attr_getdetachstate): Ditto.
(__pthread_attr_setstacksize): Ditto.
(__pthread_attr_getstacksize): Ditto.
(__pthread_attr_setinheritsched): Ditto.
(__pthread_attr_getinheritsched): Ditto.
(__pthread_attr_setschedparam): Ditto.
(__pthread_attr_getschedparam): Ditto.
(__pthread_attr_setschedpolicy): Ditto.
(__pthread_attr_getschedpolicy): Ditto.
(__pthread_attr_setscope): Ditto.
(__pthread_attr_getscope): Ditto.
(__pthread_attr_setstackaddr): Ditto.
(__pthread_attr_getstackaddr): Ditto.
(__pthread_key_create): Ditto.
(__pthread_key_delete): Ditto.
(__pthread_setspecific): Ditto.
(__pthread_getspecific): Ditto.
(__pthread_kill): Ditto.
(__pthread_sigmask): Ditto.
(__pthread_equal): Ditto.
(__pthread_mutex_lock): Ditto.
(__pthread_mutex_trylock): Ditto.
(__pthread_mutex_unlock): Ditto.
(__pthread_mutex_destroy): Ditto.
(__pthread_mutex_setprioceiling): Ditto.
(__pthread_mutex_getprioceiling): Ditto.
(__pthread_mutexattr_destroy): Ditto.
(__pthread_mutexattr_getprioceiling): Ditto.
(__pthread_mutexattr_getprotocol): Ditto.
(__pthread_mutexattr_getpshared): Ditto.
(__pthread_mutexattr_gettype): Ditto.
(__pthread_mutexattr_init): Ditto.
(__pthread_mutexattr_setprioceiling): Ditto.
(__pthread_mutexattr_setprotocol): Ditto.
(__pthread_mutexattr_setpshared): Ditto.
(__pthread_mutexattr_settype): Ditto.
(__pthread_cond_destroy): Ditto.
(__pthread_cond_signal): Ditto.
(__pthread_cond_broadcast): Ditto.
(__pthread_condattr_init): Ditto.
(__pthread_condattr_destroy): Ditto.
(__pthread_condattr_getpshared): Ditto.
(__pthread_condattr_setpshared): Ditto.
(__pthread_rwlock_destroy): Ditto.
(__pthread_rwlock_rdlock): Ditto.
(__pthread_rwlock_tryrdlock): Ditto.
(__pthread_rwlock_wrlock): Ditto.
(__pthread_rwlock_trywrlock): Ditto.
(__pthread_rwlock_unlock): Ditto.
(__pthread_rwlockattr_init): Ditto.
(__pthread_rwlockattr_getpshared): Ditto.
(__pthread_rwlockattr_setpshared): Ditto.
(__pthread_rwlockattr_destroy): Ditto.
(__pthread_getconcurrency): Ditto.
(__pthread_setconcurrency): Ditto.
(__pthread_getschedparam): Ditto.
(__pthread_setschedparam): Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 187 | ||||
-rw-r--r-- | winsup/cygwin/pthread.cc | 382 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 246 | ||||
-rw-r--r-- | winsup/cygwin/thread.h | 91 |
4 files changed, 310 insertions, 596 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index af71f9b..8126535 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,192 @@ 2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + * pthread.cc (pthread_attr_init): Remove + (pthread_attr_destroy): Ditto. + (pthread_attr_setdetachstate): Ditto. + (pthread_attr_getdetachstate): Ditto. + (pthread_attr_setstacksize): Ditto. + (pthread_attr_getstacksize): Ditto. + (pthread_attr_setinheritsched): Ditto. + (pthread_attr_getinheritsched): Ditto. + (pthread_attr_setschedparam): Ditto. + (pthread_attr_getschedparam): Ditto. + (pthread_attr_setschedpolicy): Ditto. + (pthread_attr_getschedpolicy): Ditto. + (pthread_attr_setscope): Ditto. + (pthread_attr_getscope): Ditto. + (pthread_attr_setstackaddr): Ditto. + (pthread_attr_getstackaddr): Ditto. + (pthread_key_create): Ditto. + (pthread_key_delete): Ditto. + (pthread_setspecific): Ditto. + (pthread_getspecific): Ditto. + (pthread_kill): Ditto. + (pthread_sigmask): Ditto. + (pthread_equal): Ditto. + (pthread_mutex_lock): Ditto. + (pthread_mutex_trylock): Ditto. + (pthread_mutex_unlock): Ditto. + (pthread_mutex_destroy): Ditto. + (pthread_mutex_setprioceiling): Ditto. + (pthread_mutex_getprioceiling): Ditto. + (pthread_mutexattr_destroy): Ditto. + (pthread_mutexattr_getprioceiling): Ditto. + (pthread_mutexattr_getprotocol): Ditto. + (pthread_mutexattr_getpshared): Ditto. + (pthread_mutexattr_gettype): Ditto. + (pthread_mutexattr_init): Ditto. + (pthread_mutexattr_setprioceiling): Ditto. + (pthread_mutexattr_setprotocol): Ditto. + (pthread_mutexattr_setpshared): Ditto. + (pthread_mutexattr_settype): Ditto. + (pthread_cond_destroy): Ditto. + (pthread_cond_signal): Ditto. + (pthread_cond_broadcast): Ditto. + (pthread_condattr_init): Ditto. + (pthread_condattr_destroy): Ditto. + (pthread_condattr_getpshared): Ditto. + (pthread_condattr_setpshared): Ditto. + (pthread_rwlock_destroy): Ditto. + (pthread_rwlock_rdlock): Ditto. + (pthread_rwlock_tryrdlock): Ditto. + (pthread_rwlock_wrlock): Ditto. + (pthread_rwlock_trywrlock): Ditto. + (pthread_rwlock_unlock): Ditto. + (pthread_rwlockattr_init): Ditto. + (pthread_rwlockattr_getpshared): Ditto. + (pthread_rwlockattr_setpshared): Ditto. + (pthread_rwlockattr_destroy): Ditto. + (pthread_getconcurrency): Ditto. + (pthread_setconcurrency): Ditto. + (pthread_getschedparam): Ditto. + (pthread_setschedparam): Ditto. + + * thread.h (__pthread_attr_init): Remove prototype. + (__pthread_attr_destroy): Ditto. + (__pthread_attr_setdetachstate): Ditto. + (__pthread_attr_getdetachstate): Ditto. + (__pthread_attr_setstacksize): Ditto. + (__pthread_attr_getstacksize): Ditto. + (__pthread_attr_setinheritsched): Ditto. + (__pthread_attr_getinheritsched): Ditto. + (__pthread_attr_setschedparam): Ditto. + (__pthread_attr_getschedparam): Ditto. + (__pthread_attr_setschedpolicy): Ditto. + (__pthread_attr_getschedpolicy): Ditto. + (__pthread_attr_setscope): Ditto. + (__pthread_attr_getscope): Ditto. + (__pthread_attr_setstackaddr): Ditto. + (__pthread_attr_getstackaddr): Ditto. + (__pthread_key_create): Ditto. + (__pthread_key_delete): Ditto. + (__pthread_setspecific): Ditto. + (__pthread_getspecific): Ditto. + (__pthread_kill): Ditto. + (__pthread_sigmask): Ditto. + (__pthread_equal): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutexattr_destroy): Ditto. + (__pthread_mutexattr_getprioceiling): Ditto. + (__pthread_mutexattr_getprotocol): Ditto. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + (__pthread_mutexattr_init): Ditto. + (__pthread_mutexattr_setprioceiling): Ditto. + (__pthread_mutexattr_setprotocol): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + (__pthread_mutexattr_settype): Ditto. + (__pthread_cond_destroy): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_condattr_init): Ditto. + (__pthread_condattr_destroy): Ditto. + (__pthread_condattr_getpshared): Ditto. + (__pthread_condattr_setpshared): Ditto. + (__pthread_rwlock_destroy): Ditto. + (__pthread_rwlock_rdlock): Ditto. + (__pthread_rwlock_tryrdlock): Ditto. + (__pthread_rwlock_wrlock): Ditto. + (__pthread_rwlock_trywrlock): Ditto. + (__pthread_rwlock_unlock): Ditto. + (__pthread_rwlockattr_init): Ditto. + (__pthread_rwlockattr_getpshared): Ditto. + (__pthread_rwlockattr_setpshared): Ditto. + (__pthread_rwlockattr_destroy): Ditto. + (__pthread_getconcurrency): Ditto. + (__pthread_setconcurrency): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_setschedparam): Ditto. + + * thread.cc: Rename __pthread_equal to pthread_equal throughout. + Change pthread_self parameter appropriate. + (__pthread_attr_init): Remove __ prefix. Change to extern "C". + (__pthread_attr_destroy): Ditto. + (__pthread_attr_setdetachstate): Ditto. + (__pthread_attr_getdetachstate): Ditto. + (__pthread_attr_setstacksize): Ditto. + (__pthread_attr_getstacksize): Ditto. + (__pthread_attr_setinheritsched): Ditto. + (__pthread_attr_getinheritsched): Ditto. + (__pthread_attr_setschedparam): Ditto. + (__pthread_attr_getschedparam): Ditto. + (__pthread_attr_setschedpolicy): Ditto. + (__pthread_attr_getschedpolicy): Ditto. + (__pthread_attr_setscope): Ditto. + (__pthread_attr_getscope): Ditto. + (__pthread_attr_setstackaddr): Ditto. + (__pthread_attr_getstackaddr): Ditto. + (__pthread_key_create): Ditto. + (__pthread_key_delete): Ditto. + (__pthread_setspecific): Ditto. + (__pthread_getspecific): Ditto. + (__pthread_kill): Ditto. + (__pthread_sigmask): Ditto. + (__pthread_equal): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutexattr_destroy): Ditto. + (__pthread_mutexattr_getprioceiling): Ditto. + (__pthread_mutexattr_getprotocol): Ditto. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + (__pthread_mutexattr_init): Ditto. + (__pthread_mutexattr_setprioceiling): Ditto. + (__pthread_mutexattr_setprotocol): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + (__pthread_mutexattr_settype): Ditto. + (__pthread_cond_destroy): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_condattr_init): Ditto. + (__pthread_condattr_destroy): Ditto. + (__pthread_condattr_getpshared): Ditto. + (__pthread_condattr_setpshared): Ditto. + (__pthread_rwlock_destroy): Ditto. + (__pthread_rwlock_rdlock): Ditto. + (__pthread_rwlock_tryrdlock): Ditto. + (__pthread_rwlock_wrlock): Ditto. + (__pthread_rwlock_trywrlock): Ditto. + (__pthread_rwlock_unlock): Ditto. + (__pthread_rwlockattr_init): Ditto. + (__pthread_rwlockattr_getpshared): Ditto. + (__pthread_rwlockattr_setpshared): Ditto. + (__pthread_rwlockattr_destroy): Ditto. + (__pthread_getconcurrency): Ditto. + (__pthread_setconcurrency): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_setschedparam): Ditto. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init, pthread_rwlock_rdlock, pthread_rwlock_tryrdlock, pthread_rwlock_wrlock, pthread_rwlock_trywrlock, diff --git a/winsup/cygwin/pthread.cc b/winsup/cygwin/pthread.cc index 8d629a9..cf485d4 100644 --- a/winsup/cygwin/pthread.cc +++ b/winsup/cygwin/pthread.cc @@ -36,107 +36,6 @@ pthread_atfork (void (*prepare)(void), void (*parent)(void), void (*child)(void) return pthread::atfork (prepare, parent, child); } -int -pthread_attr_init (pthread_attr_t * attr) -{ - return __pthread_attr_init (attr); -} - -int -pthread_attr_destroy (pthread_attr_t * attr) -{ - return __pthread_attr_destroy (attr); -} - -int -pthread_attr_setdetachstate (pthread_attr_t * attr, int detachstate) -{ - return __pthread_attr_setdetachstate (attr, detachstate); -} - -int -pthread_attr_getdetachstate (const pthread_attr_t * attr, int *detachstate) -{ - return __pthread_attr_getdetachstate (attr, detachstate); -} - - -int -pthread_attr_setstacksize (pthread_attr_t * attr, size_t size) -{ - return __pthread_attr_setstacksize (attr, size); -} - -int -pthread_attr_getstacksize (const pthread_attr_t * attr, size_t * size) -{ - return __pthread_attr_getstacksize (attr, size); -} - -int -pthread_attr_setinheritsched (pthread_attr_t * attr, int inheritsched) -{ - return __pthread_attr_setinheritsched (attr, inheritsched); -} - -int -pthread_attr_getinheritsched (const pthread_attr_t * attr, int *inheritsched) -{ - return __pthread_attr_getinheritsched (attr, inheritsched); -} - -int -pthread_attr_setschedparam (pthread_attr_t * attr, - const struct sched_param *param) -{ - return __pthread_attr_setschedparam (attr, param); -} - -int -pthread_attr_getschedparam (const pthread_attr_t * attr, - struct sched_param *param) -{ - return __pthread_attr_getschedparam (attr, param); -} - -int -pthread_attr_setschedpolicy (pthread_attr_t * attr, int policy) -{ - return __pthread_attr_setschedpolicy (attr, policy); -} - -int -pthread_attr_getschedpolicy (const pthread_attr_t * attr, int *policy) -{ - return __pthread_attr_getschedpolicy (attr, policy); -} - -int -pthread_attr_setscope (pthread_attr_t * attr, int contentionscope) -{ - return __pthread_attr_setscope (attr, contentionscope); -} - -int -pthread_attr_getscope (const pthread_attr_t * attr, int *contentionscope) -{ - return __pthread_attr_getscope (attr, contentionscope); -} - -#ifdef _POSIX_THREAD_ATTR_STACKADDR -int -pthread_attr_setstackaddr (pthread_attr_t * attr, void *stackaddr) -{ - return __pthread_attr_setstackaddr (attr, stackaddr); -} - -int -pthread_attr_getstackaddr (const pthread_attr_t * attr, void **stackaddr) -{ - return __pthread_attr_getstackaddr (attr, stackaddr); -} -#endif - /* Thread Exit */ void pthread_exit (void *value_ptr) @@ -179,44 +78,6 @@ pthread_getsequence_np (pthread_t * thread) return (*thread)->getsequence_np (); } -/* Thread SpecificData */ -int -pthread_key_create (pthread_key_t * key, void (*destructor) (void *)) -{ - return __pthread_key_create (key, destructor); -} - -int -pthread_key_delete (pthread_key_t key) -{ - return __pthread_key_delete (key); -} - -int -pthread_setspecific (pthread_key_t key, const void *value) -{ - return __pthread_setspecific (key, value); -} - -void * -pthread_getspecific (pthread_key_t key) -{ - return (void *) __pthread_getspecific (key); -} - -/* Thread signal */ -int -pthread_kill (pthread_t thread, int sig) -{ - return __pthread_kill (thread, sig); -} - -int -pthread_sigmask (int operation, const sigset_t * set, sigset_t * old_set) -{ - return __pthread_sigmask (operation, set, old_set); -} - /* ID */ pthread_t pthread_self () @@ -224,12 +85,6 @@ pthread_t pthread_self () return pthread::self (); } -int -pthread_equal (pthread_t t1, pthread_t t2) -{ - return __pthread_equal (&t1, &t2); -} - /* Mutexes */ int pthread_mutex_init (pthread_mutex_t * mutex, const pthread_mutexattr_t * attr) @@ -237,257 +92,20 @@ pthread_mutex_init (pthread_mutex_t * mutex, const pthread_mutexattr_t * attr) return pthread_mutex::init (mutex, attr); } -int -pthread_mutex_lock (pthread_mutex_t * mutex) -{ - return __pthread_mutex_lock (mutex); -} - -int -pthread_mutex_trylock (pthread_mutex_t * mutex) -{ - return __pthread_mutex_trylock (mutex); -} - -int -pthread_mutex_unlock (pthread_mutex_t * mutex) -{ - return __pthread_mutex_unlock (mutex); -} - -int -pthread_mutex_destroy (pthread_mutex_t * mutex) -{ - return __pthread_mutex_destroy (mutex); -} - -int -pthread_mutex_setprioceiling (pthread_mutex_t * mutex, - int prioceiling, int *old_ceiling) -{ - return __pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling); -} - -int -pthread_mutex_getprioceiling (const pthread_mutex_t * mutex, int *prioceiling) -{ - return __pthread_mutex_getprioceiling (mutex, prioceiling); -} - - - -int -pthread_mutexattr_destroy (pthread_mutexattr_t * attr) -{ - return __pthread_mutexattr_destroy (attr); -} - -int -pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * attr, - int *prioceiling) -{ - return __pthread_mutexattr_getprioceiling (attr, prioceiling); -} - -int -pthread_mutexattr_getprotocol (const pthread_mutexattr_t * attr, - int *protocol) -{ - return __pthread_mutexattr_getprotocol (attr, protocol); -} - -int -pthread_mutexattr_getpshared (const pthread_mutexattr_t * attr, int *pshared) -{ - return __pthread_mutexattr_getpshared (attr, pshared); -} - -int -pthread_mutexattr_gettype (const pthread_mutexattr_t * attr, int *type) -{ - return __pthread_mutexattr_gettype (attr, type); -} - -int -pthread_mutexattr_init (pthread_mutexattr_t * attr) -{ - return __pthread_mutexattr_init (attr); -} - -int -pthread_mutexattr_setprioceiling (pthread_mutexattr_t * attr, int prioceiling) -{ - return __pthread_mutexattr_setprioceiling (attr, prioceiling); -} - -int -pthread_mutexattr_setprotocol (pthread_mutexattr_t * attr, int protocol) -{ - return __pthread_mutexattr_setprotocol (attr, protocol); -} - -int -pthread_mutexattr_setpshared (pthread_mutexattr_t * attr, int pshared) -{ - return __pthread_mutexattr_setpshared (attr, pshared); -} - -int -pthread_mutexattr_settype (pthread_mutexattr_t * attr, int type) -{ - return __pthread_mutexattr_settype (attr, type); -} - /* Synchronisation */ - -int -pthread_cond_destroy (pthread_cond_t * cond) -{ - return __pthread_cond_destroy (cond); -} - int pthread_cond_init (pthread_cond_t * cond, const pthread_condattr_t * attr) { return pthread_cond::init (cond, attr); } -int -pthread_cond_signal (pthread_cond_t * cond) -{ - return __pthread_cond_signal (cond); -} - -int -pthread_cond_broadcast (pthread_cond_t * cond) -{ - return __pthread_cond_broadcast (cond); -} - -int -pthread_condattr_init (pthread_condattr_t * condattr) -{ - return __pthread_condattr_init (condattr); -} - -int -pthread_condattr_destroy (pthread_condattr_t * condattr) -{ - return __pthread_condattr_destroy (condattr); -} - -int -pthread_condattr_getpshared (const pthread_condattr_t * attr, int *pshared) -{ - return __pthread_condattr_getpshared (attr, pshared); -} - -int -pthread_condattr_setpshared (pthread_condattr_t * attr, int pshared) -{ - return __pthread_condattr_setpshared (attr, pshared); -} - /* RW Locks */ int -pthread_rwlock_destroy (pthread_rwlock_t *rwlock) -{ - return __pthread_rwlock_destroy (rwlock); -} - -int pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) { return pthread_rwlock::init (rwlock, attr); } -int -pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) -{ - return __pthread_rwlock_rdlock (rwlock); -} - -int -pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) -{ - return __pthread_rwlock_tryrdlock (rwlock); -} - -int -pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) -{ - return __pthread_rwlock_wrlock (rwlock); -} - -int -pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) -{ - return __pthread_rwlock_trywrlock (rwlock); -} - -int -pthread_rwlock_unlock (pthread_rwlock_t *rwlock) -{ - return __pthread_rwlock_unlock (rwlock); -} - -int -pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) -{ - return __pthread_rwlockattr_init (rwlockattr); -} - -int -pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, - int *pshared) -{ - return __pthread_rwlockattr_getpshared (attr, pshared); -} - -int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) -{ - return __pthread_rwlockattr_setpshared (attr, pshared); -} - -int -pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) -{ - return __pthread_rwlockattr_destroy (rwlockattr); -} - -/* Scheduling */ - -int -pthread_getconcurrency (void) -{ - return __pthread_getconcurrency (); -} - -int -pthread_setconcurrency (int new_level) -{ - return __pthread_setconcurrency (new_level); -} - - - - -int -pthread_getschedparam (pthread_t thread, int *policy, - struct sched_param *param) -{ - return __pthread_getschedparam (thread, policy, param); -} - -int -pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param) -{ - return __pthread_setschedparam (thread, policy, param); -} - - /* Cancelability */ int diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index ab8214e..56b2796 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -397,7 +397,7 @@ pthread::exit (void *value_ptr) mutex.Lock (); // cleanup if thread is in detached state and not joined - if (__pthread_equal (&joiner, &thread)) + if (pthread_equal (joiner, thread)) delete this; else { @@ -428,7 +428,7 @@ pthread::cancel (void) return 0; } - else if (__pthread_equal (&thread, &self)) + else if (pthread_equal (thread, self)) { mutex.UnLock (); cancel_self (); @@ -1525,7 +1525,7 @@ pthread_mutex::canBeUnlocked (pthread_mutex_t const *mutex) /* * Check if the mutex is owned by the current thread and can be unlocked */ - return (__pthread_equal (&(*mutex)->owner, &self)) && 1 == (*mutex)->recursion_counter; + return (pthread_equal ((*mutex)->owner, self)) && 1 == (*mutex)->recursion_counter; } /* This is used for mutex creation protection within a single process only */ @@ -1598,7 +1598,7 @@ pthread_mutex::_Lock (pthread_t self) if (1 == InterlockedIncrement ((long *)&lock_counter)) SetOwner (self); - else if (PTHREAD_MUTEX_NORMAL != type && __pthread_equal (&owner, &self)) + else if (PTHREAD_MUTEX_NORMAL != type && pthread_equal (owner, self)) { InterlockedDecrement ((long *) &lock_counter); if (PTHREAD_MUTEX_RECURSIVE == type) @@ -1622,7 +1622,7 @@ pthread_mutex::_TryLock (pthread_t self) if (0 == InterlockedCompareExchange ((long *)&lock_counter, 1, 0 )) SetOwner (self); - else if (PTHREAD_MUTEX_RECURSIVE == type && __pthread_equal (&owner, &self)) + else if (PTHREAD_MUTEX_RECURSIVE == type && pthread_equal (owner, self)) result = LockRecursive (); else result = EBUSY; @@ -1633,7 +1633,7 @@ pthread_mutex::_TryLock (pthread_t self) int pthread_mutex::_UnLock (pthread_t self) { - if (!__pthread_equal (&owner, &self)) + if (!pthread_equal (owner, self)) return EPERM; if (0 == --recursion_counter) @@ -2063,8 +2063,8 @@ pthread::atfork (void (*prepare)(void), void (*parent)(void), void (*child)(void return 0; } -int -__pthread_attr_init (pthread_attr_t *attr) +extern "C" int +pthread_attr_init (pthread_attr_t *attr) { if (check_valid_pointer (attr)) return EINVAL; @@ -2078,8 +2078,8 @@ __pthread_attr_init (pthread_attr_t *attr) return 0; } -int -__pthread_attr_getinheritsched (const pthread_attr_t *attr, +extern "C" int +pthread_attr_getinheritsched (const pthread_attr_t *attr, int *inheritsched) { if (!pthread_attr::isGoodObject (attr)) @@ -2088,8 +2088,8 @@ __pthread_attr_getinheritsched (const pthread_attr_t *attr, return 0; } -int -__pthread_attr_getschedparam (const pthread_attr_t *attr, +extern "C" int +pthread_attr_getschedparam (const pthread_attr_t *attr, struct sched_param *param) { if (!pthread_attr::isGoodObject (attr)) @@ -2101,8 +2101,8 @@ __pthread_attr_getschedparam (const pthread_attr_t *attr, /* From a pure code point of view, this should call a helper in sched.cc, to allow for someone adding scheduler policy changes to win32 in the future. However that's extremely unlikely, so short and sweet will do us */ -int -__pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) +extern "C" int +pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2111,8 +2111,8 @@ __pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) } -int -__pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope) +extern "C" int +pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2120,8 +2120,8 @@ __pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope) return 0; } -int -__pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) +extern "C" int +pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2131,8 +2131,8 @@ __pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) return 0; } -int -__pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) +extern "C" int +pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2140,8 +2140,8 @@ __pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) return 0; } -int -__pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) +extern "C" int +pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2152,8 +2152,8 @@ __pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) return 0; } -int -__pthread_attr_setschedparam (pthread_attr_t *attr, +extern "C" int +pthread_attr_setschedparam (pthread_attr_t *attr, const struct sched_param *param) { if (!pthread_attr::isGoodObject (attr)) @@ -2165,8 +2165,8 @@ __pthread_attr_setschedparam (pthread_attr_t *attr, } /* See __pthread_attr_getschedpolicy for some notes */ -int -__pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) +extern "C" int +pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2175,8 +2175,8 @@ __pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) return 0; } -int -__pthread_attr_setscope (pthread_attr_t *attr, int contentionscope) +extern "C" int +pthread_attr_setscope (pthread_attr_t *attr, int contentionscope) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2191,8 +2191,8 @@ __pthread_attr_setscope (pthread_attr_t *attr, int contentionscope) return 0; } -int -__pthread_attr_setstacksize (pthread_attr_t *attr, size_t size) +extern "C" int +pthread_attr_setstacksize (pthread_attr_t *attr, size_t size) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2200,8 +2200,8 @@ __pthread_attr_setstacksize (pthread_attr_t *attr, size_t size) return 0; } -int -__pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size) +extern "C" int +pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2209,8 +2209,8 @@ __pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size) return 0; } -int -__pthread_attr_destroy (pthread_attr_t *attr) +extern "C" int +pthread_attr_destroy (pthread_attr_t *attr) { if (!pthread_attr::isGoodObject (attr)) return EINVAL; @@ -2236,7 +2236,7 @@ pthread::join (pthread_t *thread, void **return_val) if (!isGoodObject (thread)) return ESRCH; - if (__pthread_equal (thread,&joiner)) + if (pthread_equal (*thread,joiner)) return EDEADLK; (*thread)->mutex.Lock (); @@ -2338,15 +2338,15 @@ pthread::resume (pthread_t *thread) /* provided for source level compatability. See http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_getconcurrency.html */ -int -__pthread_getconcurrency (void) +extern "C" int +pthread_getconcurrency (void) { return MT_INTERFACE->concurrency; } /* keep this in sync with sched.cc */ -int -__pthread_getschedparam (pthread_t thread, int *policy, +extern "C" int +pthread_getschedparam (pthread_t thread, int *policy, struct sched_param *param) { if (!pthread::isGoodObject (&thread)) @@ -2359,8 +2359,8 @@ __pthread_getschedparam (pthread_t thread, int *policy, } /* Thread SpecificData */ -int -__pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) +extern "C" int +pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) { /* The opengroup docs don't define if we should check this or not, but creation is relatively rare. */ @@ -2378,8 +2378,8 @@ __pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) return 0; } -int -__pthread_key_delete (pthread_key_t key) +extern "C" int +pthread_key_delete (pthread_key_t key) { if (!pthread_key::isGoodObject (&key)) return EINVAL; @@ -2391,8 +2391,8 @@ __pthread_key_delete (pthread_key_t key) /* provided for source level compatability. See http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_getconcurrency.html */ -int -__pthread_setconcurrency (int new_level) +extern "C" int +pthread_setconcurrency (int new_level) { if (new_level < 0) return EINVAL; @@ -2401,8 +2401,8 @@ __pthread_setconcurrency (int new_level) } /* keep syncronised with sched.cc */ -int -__pthread_setschedparam (pthread_t thread, int policy, +extern "C" int +pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param) { if (!pthread::isGoodObject (&thread)) @@ -2419,8 +2419,8 @@ __pthread_setschedparam (pthread_t thread, int policy, } -int -__pthread_setspecific (pthread_key_t key, const void *value) +extern "C" int +pthread_setspecific (pthread_key_t key, const void *value) { if (!pthread_key::isGoodObject (&key)) return EINVAL; @@ -2428,8 +2428,8 @@ __pthread_setspecific (pthread_key_t key, const void *value) return 0; } -void * -__pthread_getspecific (pthread_key_t key) +extern "C" void * +pthread_getspecific (pthread_key_t key) { if (!pthread_key::isGoodObject (&key)) return NULL; @@ -2472,8 +2472,8 @@ pthread_cond::isGoodInitializerOrBadObject (pthread_cond_t const *cond) return true; } -int -__pthread_cond_destroy (pthread_cond_t *cond) +extern "C" int +pthread_cond_destroy (pthread_cond_t *cond) { if (pthread_cond::isGoodInitializer (cond)) return 0; @@ -2516,8 +2516,8 @@ pthread_cond::init (pthread_cond_t *cond, const pthread_condattr_t *attr) return 0; } -int -__pthread_cond_broadcast (pthread_cond_t *cond) +extern "C" int +pthread_cond_broadcast (pthread_cond_t *cond) { if (pthread_cond::isGoodInitializer (cond)) return 0; @@ -2529,8 +2529,8 @@ __pthread_cond_broadcast (pthread_cond_t *cond) return 0; } -int -__pthread_cond_signal (pthread_cond_t *cond) +extern "C" int +pthread_cond_signal (pthread_cond_t *cond) { if (pthread_cond::isGoodInitializer (cond)) return 0; @@ -2587,8 +2587,8 @@ pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) return __pthread_cond_dowait (cond, mutex, INFINITE); } -int -__pthread_condattr_init (pthread_condattr_t *condattr) +extern "C" int +pthread_condattr_init (pthread_condattr_t *condattr) { if (check_valid_pointer (condattr)) return EINVAL; @@ -2602,8 +2602,8 @@ __pthread_condattr_init (pthread_condattr_t *condattr) return 0; } -int -__pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) +extern "C" int +pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) { if (!pthread_condattr::isGoodObject (attr)) return EINVAL; @@ -2611,8 +2611,8 @@ __pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) return 0; } -int -__pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) +extern "C" int +pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) { if (!pthread_condattr::isGoodObject (attr)) return EINVAL; @@ -2625,8 +2625,8 @@ __pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) return 0; } -int -__pthread_condattr_destroy (pthread_condattr_t *condattr) +extern "C" int +pthread_condattr_destroy (pthread_condattr_t *condattr) { if (!pthread_condattr::isGoodObject (condattr)) return EINVAL; @@ -2669,8 +2669,8 @@ pthread_rwlock::isGoodInitializerOrBadObject (pthread_rwlock_t const *rwlock) return true; } -int -__pthread_rwlock_destroy (pthread_rwlock_t *rwlock) +extern "C" int +pthread_rwlock_destroy (pthread_rwlock_t *rwlock) { if (pthread_rwlock::isGoodInitializer (rwlock)) return 0; @@ -2713,8 +2713,8 @@ pthread_rwlock::init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr return 0; } -int -__pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) +extern "C" int +pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) { pthread_testcancel (); @@ -2726,8 +2726,8 @@ __pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) return (*rwlock)->RdLock (); } -int -__pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) +extern "C" int +pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) { if (pthread_rwlock::isGoodInitializer (rwlock)) pthread_rwlock::init (rwlock, NULL); @@ -2737,8 +2737,8 @@ __pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) return (*rwlock)->TryRdLock (); } -int -__pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) +extern "C" int +pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) { pthread_testcancel (); @@ -2750,8 +2750,8 @@ __pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) return (*rwlock)->WrLock (); } -int -__pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) +extern "C" int +pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) { if (pthread_rwlock::isGoodInitializer (rwlock)) pthread_rwlock::init (rwlock, NULL); @@ -2761,8 +2761,8 @@ __pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) return (*rwlock)->TryWrLock (); } -int -__pthread_rwlock_unlock (pthread_rwlock_t *rwlock) +extern "C" int +pthread_rwlock_unlock (pthread_rwlock_t *rwlock) { if (pthread_rwlock::isGoodInitializer (rwlock)) return 0; @@ -2772,8 +2772,8 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) return (*rwlock)->UnLock (); } -int -__pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) +extern "C" int +pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) { if (check_valid_pointer (rwlockattr)) return EINVAL; @@ -2787,8 +2787,8 @@ __pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) return 0; } -int -__pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared) +extern "C" int +pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared) { if (!pthread_rwlockattr::isGoodObject (attr)) return EINVAL; @@ -2796,8 +2796,8 @@ __pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared) return 0; } -int -__pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) +extern "C" int +pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) { if (!pthread_rwlockattr::isGoodObject (attr)) return EINVAL; @@ -2810,8 +2810,8 @@ __pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) return 0; } -int -__pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) +extern "C" int +pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) { if (!pthread_rwlockattr::isGoodObject (rwlockattr)) return EINVAL; @@ -2821,8 +2821,8 @@ __pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) } /* Thread signal */ -int -__pthread_kill (pthread_t thread, int sig) +extern "C" int +pthread_kill (pthread_t thread, int sig) { // lock myself, for the use of thread2signal // two different kills might clash: FIXME @@ -2839,8 +2839,8 @@ __pthread_kill (pthread_t thread, int sig) return rval; } -int -__pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set) +extern "C" int +pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set) { pthread *thread = pthread::self (); @@ -2860,9 +2860,9 @@ __pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set) /* ID */ int -__pthread_equal (pthread_t *t1, pthread_t *t2) +pthread_equal (pthread_t t1, pthread_t t2) { - return (*t1 == *t2); + return t1 == t2; } /* Mutexes */ @@ -2902,8 +2902,8 @@ pthread_mutex::init (pthread_mutex_t *mutex, return 0; } -int -__pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, +extern "C" int +pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, int *prioceiling) { pthread_mutex_t *themutex = (pthread_mutex_t *) mutex; @@ -2922,7 +2922,7 @@ __pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, } int -__pthread_mutex_lock (pthread_mutex_t *mutex) +pthread_mutex_lock (pthread_mutex_t *mutex) { pthread_mutex_t *themutex = mutex; /* This could be simplified via isGoodInitializerOrObject @@ -2949,8 +2949,8 @@ __pthread_mutex_lock (pthread_mutex_t *mutex) return (*themutex)->Lock (); } -int -__pthread_mutex_trylock (pthread_mutex_t *mutex) +extern "C" int +pthread_mutex_trylock (pthread_mutex_t *mutex) { pthread_mutex_t *themutex = mutex; if (pthread_mutex::isGoodInitializer (mutex)) @@ -2960,8 +2960,8 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex) return (*themutex)->TryLock (); } -int -__pthread_mutex_unlock (pthread_mutex_t *mutex) +extern "C" int +pthread_mutex_unlock (pthread_mutex_t *mutex) { if (pthread_mutex::isGoodInitializer (mutex)) pthread_mutex::init (mutex, NULL); @@ -2970,8 +2970,8 @@ __pthread_mutex_unlock (pthread_mutex_t *mutex) return (*mutex)->UnLock (); } -int -__pthread_mutex_destroy (pthread_mutex_t *mutex) +extern "C" int +pthread_mutex_destroy (pthread_mutex_t *mutex) { int rv; @@ -2988,8 +2988,8 @@ __pthread_mutex_destroy (pthread_mutex_t *mutex) return 0; } -int -__pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling, +extern "C" int +pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling, int *old_ceiling) { pthread_mutex_t *themutex = mutex; @@ -3002,8 +3002,8 @@ __pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling, /* Win32 doesn't support mutex priorities - see __pthread_mutex_getprioceiling for more detail */ -int -__pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, +extern "C" int +pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, int *protocol) { if (!pthread_mutexattr::isGoodObject (attr)) @@ -3011,8 +3011,8 @@ __pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, return ENOSYS; } -int -__pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, +extern "C" int +pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, int *pshared) { if (!pthread_mutexattr::isGoodObject (attr)) @@ -3021,8 +3021,8 @@ __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, return 0; } -int -__pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type) +extern "C" int +pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type) { if (!pthread_mutexattr::isGoodObject (attr)) return EINVAL; @@ -3031,8 +3031,8 @@ __pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type) } /* FIXME: write and test process shared mutex's. */ -int -__pthread_mutexattr_init (pthread_mutexattr_t *attr) +extern "C" int +pthread_mutexattr_init (pthread_mutexattr_t *attr) { if (pthread_mutexattr::isGoodObject (attr)) return EBUSY; @@ -3047,8 +3047,8 @@ __pthread_mutexattr_init (pthread_mutexattr_t *attr) return 0; } -int -__pthread_mutexattr_destroy (pthread_mutexattr_t *attr) +extern "C" int +pthread_mutexattr_destroy (pthread_mutexattr_t *attr) { if (!pthread_mutexattr::isGoodObject (attr)) return EINVAL; @@ -3059,8 +3059,8 @@ __pthread_mutexattr_destroy (pthread_mutexattr_t *attr) /* Win32 doesn't support mutex priorities */ -int -__pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) +extern "C" int +pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) { if (!pthread_mutexattr::isGoodObject (attr)) return EINVAL; @@ -3068,8 +3068,8 @@ __pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) } /* Win32 doesn't support mutex priorities */ -int -__pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, +extern "C" int +pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, int prioceiling) { if (!pthread_mutexattr::isGoodObject (attr)) @@ -3077,8 +3077,8 @@ __pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, return ENOSYS; } -int -__pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, +extern "C" int +pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, int *prioceiling) { if (!pthread_mutexattr::isGoodObject (attr)) @@ -3086,8 +3086,8 @@ __pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, return ENOSYS; } -int -__pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) +extern "C" int +pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) { if (!pthread_mutexattr::isGoodObject (attr)) return EINVAL; @@ -3100,9 +3100,9 @@ __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) return 0; } -/* see __pthread_mutex_gettype */ -int -__pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type) +/* see pthread_mutex_gettype */ +extern "C" int +pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type) { if (!pthread_mutexattr::isGoodObject (attr)) return EINVAL; diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index 58be95c..a3418fb 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -658,97 +658,6 @@ public: #define MT_INTERFACE user_data->threadinterface -extern "C" -{ -int __pthread_attr_init (pthread_attr_t * attr); -int __pthread_attr_destroy (pthread_attr_t * attr); -int __pthread_attr_setdetachstate (pthread_attr_t *, int); -int __pthread_attr_getdetachstate (const pthread_attr_t *, int *); -int __pthread_attr_setstacksize (pthread_attr_t * attr, size_t size); -int __pthread_attr_getstacksize (const pthread_attr_t * attr, size_t * size); - -int __pthread_attr_getinheritsched (const pthread_attr_t *, int *); -int __pthread_attr_getschedparam (const pthread_attr_t *, - struct sched_param *); -int __pthread_attr_getschedpolicy (const pthread_attr_t *, int *); -int __pthread_attr_getscope (const pthread_attr_t *, int *); -int __pthread_attr_getstackaddr (const pthread_attr_t *, void **); -int __pthread_attr_setinheritsched (pthread_attr_t *, int); -int __pthread_attr_setschedparam (pthread_attr_t *, - const struct sched_param *); -int __pthread_attr_setschedpolicy (pthread_attr_t *, int); -int __pthread_attr_setscope (pthread_attr_t *, int); -int __pthread_attr_setstackaddr (pthread_attr_t *, void *); - -/* Thread SpecificData */ -int __pthread_key_create (pthread_key_t * key, void (*destructor) (void *)); -int __pthread_key_delete (pthread_key_t key); -int __pthread_setspecific (pthread_key_t key, const void *value); -void *__pthread_getspecific (pthread_key_t key); - -/* Thead synchroniation */ -int __pthread_cond_destroy (pthread_cond_t * cond); -int __pthread_cond_signal (pthread_cond_t * cond); -int __pthread_cond_broadcast (pthread_cond_t * cond); -int __pthread_condattr_init (pthread_condattr_t * condattr); -int __pthread_condattr_destroy (pthread_condattr_t * condattr); -int __pthread_condattr_getpshared (const pthread_condattr_t * attr, - int *pshared); -int __pthread_condattr_setpshared (pthread_condattr_t * attr, int pshared); - -/* RW locks */ -int __pthread_rwlock_destroy (pthread_rwlock_t *rwlock); -int __pthread_rwlock_rdlock (pthread_rwlock_t *rwlock); -int __pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock); -int __pthread_rwlock_wrlock (pthread_rwlock_t *rwlock); -int __pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock); -int __pthread_rwlock_unlock (pthread_rwlock_t *rwlock); -int __pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr); -int __pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, - int *pshared); -int __pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared); -int __pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr); - -/* Thread signal */ -int __pthread_kill (pthread_t thread, int sig); -int __pthread_sigmask (int operation, const sigset_t * set, - sigset_t * old_set); - -/* ID */ -int __pthread_equal (pthread_t * t1, pthread_t * t2); - -/* Mutexes */ -int __pthread_mutex_lock (pthread_mutex_t *); -int __pthread_mutex_trylock (pthread_mutex_t *); -int __pthread_mutex_unlock (pthread_mutex_t *); -int __pthread_mutex_destroy (pthread_mutex_t *); -int __pthread_mutex_setprioceiling (pthread_mutex_t * mutex, - int prioceiling, int *old_ceiling); -int __pthread_mutex_getprioceiling (const pthread_mutex_t * mutex, - int *prioceiling); - - -int __pthread_mutexattr_destroy (pthread_mutexattr_t *); -int __pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *, int *); -int __pthread_mutexattr_getprotocol (const pthread_mutexattr_t *, int *); -int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *, int *); -int __pthread_mutexattr_gettype (const pthread_mutexattr_t *, int *); -int __pthread_mutexattr_init (pthread_mutexattr_t *); -int __pthread_mutexattr_setprioceiling (pthread_mutexattr_t *, int); -int __pthread_mutexattr_setprotocol (pthread_mutexattr_t *, int); -int __pthread_mutexattr_setpshared (pthread_mutexattr_t *, int); -int __pthread_mutexattr_settype (pthread_mutexattr_t *, int); - - -/* Scheduling */ -int __pthread_getconcurrency (void); -int __pthread_setconcurrency (int new_level); -int __pthread_getschedparam (pthread_t thread, int *policy, - struct sched_param *param); -int __pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param); - -}; #endif // MT_SAFE #endif // _CYGNUS_THREADS_ |