* 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.
This commit is contained in:
Thomas Pfaff 2003-03-18 20:12:05 +00:00
parent 4fd9bca85e
commit 6a80a133be
4 changed files with 310 additions and 596 deletions

View File

@ -1,3 +1,190 @@
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> 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
* cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init, * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init,

View File

@ -36,107 +36,6 @@ pthread_atfork (void (*prepare)(void), void (*parent)(void), void (*child)(void)
return pthread::atfork (prepare, parent, child); 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 */ /* Thread Exit */
void void
pthread_exit (void *value_ptr) pthread_exit (void *value_ptr)
@ -179,44 +78,6 @@ pthread_getsequence_np (pthread_t * thread)
return (*thread)->getsequence_np (); 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 */ /* ID */
pthread_t pthread_self () pthread_t pthread_self ()
@ -224,12 +85,6 @@ pthread_t pthread_self ()
return pthread::self (); return pthread::self ();
} }
int
pthread_equal (pthread_t t1, pthread_t t2)
{
return __pthread_equal (&t1, &t2);
}
/* Mutexes */ /* Mutexes */
int int
pthread_mutex_init (pthread_mutex_t * mutex, const pthread_mutexattr_t * attr) 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); 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 */ /* Synchronisation */
int
pthread_cond_destroy (pthread_cond_t * cond)
{
return __pthread_cond_destroy (cond);
}
int int
pthread_cond_init (pthread_cond_t * cond, const pthread_condattr_t * attr) pthread_cond_init (pthread_cond_t * cond, const pthread_condattr_t * attr)
{ {
return pthread_cond::init (cond, 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 */ /* RW Locks */
int
pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
{
return __pthread_rwlock_destroy (rwlock);
}
int int
pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
{ {
return pthread_rwlock::init (rwlock, 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 */ /* Cancelability */
int int

View File

@ -397,7 +397,7 @@ pthread::exit (void *value_ptr)
mutex.Lock (); mutex.Lock ();
// cleanup if thread is in detached state and not joined // cleanup if thread is in detached state and not joined
if (__pthread_equal (&joiner, &thread)) if (pthread_equal (joiner, thread))
delete this; delete this;
else else
{ {
@ -428,7 +428,7 @@ pthread::cancel (void)
return 0; return 0;
} }
else if (__pthread_equal (&thread, &self)) else if (pthread_equal (thread, self))
{ {
mutex.UnLock (); mutex.UnLock ();
cancel_self (); 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 * 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 */ /* 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)) if (1 == InterlockedIncrement ((long *)&lock_counter))
SetOwner (self); 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); InterlockedDecrement ((long *) &lock_counter);
if (PTHREAD_MUTEX_RECURSIVE == type) if (PTHREAD_MUTEX_RECURSIVE == type)
@ -1622,7 +1622,7 @@ pthread_mutex::_TryLock (pthread_t self)
if (0 == InterlockedCompareExchange ((long *)&lock_counter, 1, 0 )) if (0 == InterlockedCompareExchange ((long *)&lock_counter, 1, 0 ))
SetOwner (self); SetOwner (self);
else if (PTHREAD_MUTEX_RECURSIVE == type && __pthread_equal (&owner, &self)) else if (PTHREAD_MUTEX_RECURSIVE == type && pthread_equal (owner, self))
result = LockRecursive (); result = LockRecursive ();
else else
result = EBUSY; result = EBUSY;
@ -1633,7 +1633,7 @@ pthread_mutex::_TryLock (pthread_t self)
int int
pthread_mutex::_UnLock (pthread_t self) pthread_mutex::_UnLock (pthread_t self)
{ {
if (!__pthread_equal (&owner, &self)) if (!pthread_equal (owner, self))
return EPERM; return EPERM;
if (0 == --recursion_counter) if (0 == --recursion_counter)
@ -2063,8 +2063,8 @@ pthread::atfork (void (*prepare)(void), void (*parent)(void), void (*child)(void
return 0; return 0;
} }
int extern "C" int
__pthread_attr_init (pthread_attr_t *attr) pthread_attr_init (pthread_attr_t *attr)
{ {
if (check_valid_pointer (attr)) if (check_valid_pointer (attr))
return EINVAL; return EINVAL;
@ -2078,8 +2078,8 @@ __pthread_attr_init (pthread_attr_t *attr)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_getinheritsched (const pthread_attr_t *attr, pthread_attr_getinheritsched (const pthread_attr_t *attr,
int *inheritsched) int *inheritsched)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
@ -2088,8 +2088,8 @@ __pthread_attr_getinheritsched (const pthread_attr_t *attr,
return 0; return 0;
} }
int extern "C" int
__pthread_attr_getschedparam (const pthread_attr_t *attr, pthread_attr_getschedparam (const pthread_attr_t *attr,
struct sched_param *param) struct sched_param *param)
{ {
if (!pthread_attr::isGoodObject (attr)) 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, /* 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. 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 */ However that's extremely unlikely, so short and sweet will do us */
int extern "C" int
__pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2111,8 +2111,8 @@ __pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy)
} }
int extern "C" int
__pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope) pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2120,8 +2120,8 @@ __pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2131,8 +2131,8 @@ __pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2140,8 +2140,8 @@ __pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2152,8 +2152,8 @@ __pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_setschedparam (pthread_attr_t *attr, pthread_attr_setschedparam (pthread_attr_t *attr,
const struct sched_param *param) const struct sched_param *param)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
@ -2165,8 +2165,8 @@ __pthread_attr_setschedparam (pthread_attr_t *attr,
} }
/* See __pthread_attr_getschedpolicy for some notes */ /* See __pthread_attr_getschedpolicy for some notes */
int extern "C" int
__pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2175,8 +2175,8 @@ __pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_setscope (pthread_attr_t *attr, int contentionscope) pthread_attr_setscope (pthread_attr_t *attr, int contentionscope)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2191,8 +2191,8 @@ __pthread_attr_setscope (pthread_attr_t *attr, int contentionscope)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_setstacksize (pthread_attr_t *attr, size_t size) pthread_attr_setstacksize (pthread_attr_t *attr, size_t size)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2200,8 +2200,8 @@ __pthread_attr_setstacksize (pthread_attr_t *attr, size_t size)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size) pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2209,8 +2209,8 @@ __pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size)
return 0; return 0;
} }
int extern "C" int
__pthread_attr_destroy (pthread_attr_t *attr) pthread_attr_destroy (pthread_attr_t *attr)
{ {
if (!pthread_attr::isGoodObject (attr)) if (!pthread_attr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2236,7 +2236,7 @@ pthread::join (pthread_t *thread, void **return_val)
if (!isGoodObject (thread)) if (!isGoodObject (thread))
return ESRCH; return ESRCH;
if (__pthread_equal (thread,&joiner)) if (pthread_equal (*thread,joiner))
return EDEADLK; return EDEADLK;
(*thread)->mutex.Lock (); (*thread)->mutex.Lock ();
@ -2338,15 +2338,15 @@ pthread::resume (pthread_t *thread)
/* provided for source level compatability. /* provided for source level compatability.
See http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_getconcurrency.html See http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_getconcurrency.html
*/ */
int extern "C" int
__pthread_getconcurrency (void) pthread_getconcurrency (void)
{ {
return MT_INTERFACE->concurrency; return MT_INTERFACE->concurrency;
} }
/* keep this in sync with sched.cc */ /* keep this in sync with sched.cc */
int extern "C" int
__pthread_getschedparam (pthread_t thread, int *policy, pthread_getschedparam (pthread_t thread, int *policy,
struct sched_param *param) struct sched_param *param)
{ {
if (!pthread::isGoodObject (&thread)) if (!pthread::isGoodObject (&thread))
@ -2359,8 +2359,8 @@ __pthread_getschedparam (pthread_t thread, int *policy,
} }
/* Thread SpecificData */ /* Thread SpecificData */
int extern "C" int
__pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) pthread_key_create (pthread_key_t *key, void (*destructor) (void *))
{ {
/* The opengroup docs don't define if we should check this or not, /* The opengroup docs don't define if we should check this or not,
but creation is relatively rare. */ but creation is relatively rare. */
@ -2378,8 +2378,8 @@ __pthread_key_create (pthread_key_t *key, void (*destructor) (void *))
return 0; return 0;
} }
int extern "C" int
__pthread_key_delete (pthread_key_t key) pthread_key_delete (pthread_key_t key)
{ {
if (!pthread_key::isGoodObject (&key)) if (!pthread_key::isGoodObject (&key))
return EINVAL; return EINVAL;
@ -2391,8 +2391,8 @@ __pthread_key_delete (pthread_key_t key)
/* provided for source level compatability. See /* provided for source level compatability. See
http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_getconcurrency.html http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_getconcurrency.html
*/ */
int extern "C" int
__pthread_setconcurrency (int new_level) pthread_setconcurrency (int new_level)
{ {
if (new_level < 0) if (new_level < 0)
return EINVAL; return EINVAL;
@ -2401,8 +2401,8 @@ __pthread_setconcurrency (int new_level)
} }
/* keep syncronised with sched.cc */ /* keep syncronised with sched.cc */
int extern "C" int
__pthread_setschedparam (pthread_t thread, int policy, pthread_setschedparam (pthread_t thread, int policy,
const struct sched_param *param) const struct sched_param *param)
{ {
if (!pthread::isGoodObject (&thread)) if (!pthread::isGoodObject (&thread))
@ -2419,8 +2419,8 @@ __pthread_setschedparam (pthread_t thread, int policy,
} }
int extern "C" int
__pthread_setspecific (pthread_key_t key, const void *value) pthread_setspecific (pthread_key_t key, const void *value)
{ {
if (!pthread_key::isGoodObject (&key)) if (!pthread_key::isGoodObject (&key))
return EINVAL; return EINVAL;
@ -2428,8 +2428,8 @@ __pthread_setspecific (pthread_key_t key, const void *value)
return 0; return 0;
} }
void * extern "C" void *
__pthread_getspecific (pthread_key_t key) pthread_getspecific (pthread_key_t key)
{ {
if (!pthread_key::isGoodObject (&key)) if (!pthread_key::isGoodObject (&key))
return NULL; return NULL;
@ -2472,8 +2472,8 @@ pthread_cond::isGoodInitializerOrBadObject (pthread_cond_t const *cond)
return true; return true;
} }
int extern "C" int
__pthread_cond_destroy (pthread_cond_t *cond) pthread_cond_destroy (pthread_cond_t *cond)
{ {
if (pthread_cond::isGoodInitializer (cond)) if (pthread_cond::isGoodInitializer (cond))
return 0; return 0;
@ -2516,8 +2516,8 @@ pthread_cond::init (pthread_cond_t *cond, const pthread_condattr_t *attr)
return 0; return 0;
} }
int extern "C" int
__pthread_cond_broadcast (pthread_cond_t *cond) pthread_cond_broadcast (pthread_cond_t *cond)
{ {
if (pthread_cond::isGoodInitializer (cond)) if (pthread_cond::isGoodInitializer (cond))
return 0; return 0;
@ -2529,8 +2529,8 @@ __pthread_cond_broadcast (pthread_cond_t *cond)
return 0; return 0;
} }
int extern "C" int
__pthread_cond_signal (pthread_cond_t *cond) pthread_cond_signal (pthread_cond_t *cond)
{ {
if (pthread_cond::isGoodInitializer (cond)) if (pthread_cond::isGoodInitializer (cond))
return 0; return 0;
@ -2587,8 +2587,8 @@ pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
return __pthread_cond_dowait (cond, mutex, INFINITE); return __pthread_cond_dowait (cond, mutex, INFINITE);
} }
int extern "C" int
__pthread_condattr_init (pthread_condattr_t *condattr) pthread_condattr_init (pthread_condattr_t *condattr)
{ {
if (check_valid_pointer (condattr)) if (check_valid_pointer (condattr))
return EINVAL; return EINVAL;
@ -2602,8 +2602,8 @@ __pthread_condattr_init (pthread_condattr_t *condattr)
return 0; return 0;
} }
int extern "C" int
__pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
{ {
if (!pthread_condattr::isGoodObject (attr)) if (!pthread_condattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2611,8 +2611,8 @@ __pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
return 0; return 0;
} }
int extern "C" int
__pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared)
{ {
if (!pthread_condattr::isGoodObject (attr)) if (!pthread_condattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2625,8 +2625,8 @@ __pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared)
return 0; return 0;
} }
int extern "C" int
__pthread_condattr_destroy (pthread_condattr_t *condattr) pthread_condattr_destroy (pthread_condattr_t *condattr)
{ {
if (!pthread_condattr::isGoodObject (condattr)) if (!pthread_condattr::isGoodObject (condattr))
return EINVAL; return EINVAL;
@ -2669,8 +2669,8 @@ pthread_rwlock::isGoodInitializerOrBadObject (pthread_rwlock_t const *rwlock)
return true; return true;
} }
int extern "C" int
__pthread_rwlock_destroy (pthread_rwlock_t *rwlock) pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
{ {
if (pthread_rwlock::isGoodInitializer (rwlock)) if (pthread_rwlock::isGoodInitializer (rwlock))
return 0; return 0;
@ -2713,8 +2713,8 @@ pthread_rwlock::init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr
return 0; return 0;
} }
int extern "C" int
__pthread_rwlock_rdlock (pthread_rwlock_t *rwlock) pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
{ {
pthread_testcancel (); pthread_testcancel ();
@ -2726,8 +2726,8 @@ __pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
return (*rwlock)->RdLock (); return (*rwlock)->RdLock ();
} }
int extern "C" int
__pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock) pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
{ {
if (pthread_rwlock::isGoodInitializer (rwlock)) if (pthread_rwlock::isGoodInitializer (rwlock))
pthread_rwlock::init (rwlock, NULL); pthread_rwlock::init (rwlock, NULL);
@ -2737,8 +2737,8 @@ __pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
return (*rwlock)->TryRdLock (); return (*rwlock)->TryRdLock ();
} }
int extern "C" int
__pthread_rwlock_wrlock (pthread_rwlock_t *rwlock) pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
{ {
pthread_testcancel (); pthread_testcancel ();
@ -2750,8 +2750,8 @@ __pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
return (*rwlock)->WrLock (); return (*rwlock)->WrLock ();
} }
int extern "C" int
__pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock) pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
{ {
if (pthread_rwlock::isGoodInitializer (rwlock)) if (pthread_rwlock::isGoodInitializer (rwlock))
pthread_rwlock::init (rwlock, NULL); pthread_rwlock::init (rwlock, NULL);
@ -2761,8 +2761,8 @@ __pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
return (*rwlock)->TryWrLock (); return (*rwlock)->TryWrLock ();
} }
int extern "C" int
__pthread_rwlock_unlock (pthread_rwlock_t *rwlock) pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
{ {
if (pthread_rwlock::isGoodInitializer (rwlock)) if (pthread_rwlock::isGoodInitializer (rwlock))
return 0; return 0;
@ -2772,8 +2772,8 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
return (*rwlock)->UnLock (); return (*rwlock)->UnLock ();
} }
int extern "C" int
__pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr) pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr)
{ {
if (check_valid_pointer (rwlockattr)) if (check_valid_pointer (rwlockattr))
return EINVAL; return EINVAL;
@ -2787,8 +2787,8 @@ __pthread_rwlockattr_init (pthread_rwlockattr_t *rwlockattr)
return 0; return 0;
} }
int extern "C" int
__pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared) pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared)
{ {
if (!pthread_rwlockattr::isGoodObject (attr)) if (!pthread_rwlockattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2796,8 +2796,8 @@ __pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared)
return 0; return 0;
} }
int extern "C" int
__pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared)
{ {
if (!pthread_rwlockattr::isGoodObject (attr)) if (!pthread_rwlockattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -2810,8 +2810,8 @@ __pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared)
return 0; return 0;
} }
int extern "C" int
__pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr) pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr)
{ {
if (!pthread_rwlockattr::isGoodObject (rwlockattr)) if (!pthread_rwlockattr::isGoodObject (rwlockattr))
return EINVAL; return EINVAL;
@ -2821,8 +2821,8 @@ __pthread_rwlockattr_destroy (pthread_rwlockattr_t *rwlockattr)
} }
/* Thread signal */ /* Thread signal */
int extern "C" int
__pthread_kill (pthread_t thread, int sig) pthread_kill (pthread_t thread, int sig)
{ {
// lock myself, for the use of thread2signal // lock myself, for the use of thread2signal
// two different kills might clash: FIXME // two different kills might clash: FIXME
@ -2839,8 +2839,8 @@ __pthread_kill (pthread_t thread, int sig)
return rval; return rval;
} }
int extern "C" int
__pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set) pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set)
{ {
pthread *thread = pthread::self (); pthread *thread = pthread::self ();
@ -2860,9 +2860,9 @@ __pthread_sigmask (int operation, const sigset_t *set, sigset_t *old_set)
/* ID */ /* ID */
int int
__pthread_equal (pthread_t *t1, pthread_t *t2) pthread_equal (pthread_t t1, pthread_t t2)
{ {
return (*t1 == *t2); return t1 == t2;
} }
/* Mutexes */ /* Mutexes */
@ -2902,8 +2902,8 @@ pthread_mutex::init (pthread_mutex_t *mutex,
return 0; return 0;
} }
int extern "C" int
__pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, pthread_mutex_getprioceiling (const pthread_mutex_t *mutex,
int *prioceiling) int *prioceiling)
{ {
pthread_mutex_t *themutex = (pthread_mutex_t *) mutex; pthread_mutex_t *themutex = (pthread_mutex_t *) mutex;
@ -2922,7 +2922,7 @@ __pthread_mutex_getprioceiling (const pthread_mutex_t *mutex,
} }
int int
__pthread_mutex_lock (pthread_mutex_t *mutex) pthread_mutex_lock (pthread_mutex_t *mutex)
{ {
pthread_mutex_t *themutex = mutex; pthread_mutex_t *themutex = mutex;
/* This could be simplified via isGoodInitializerOrObject /* This could be simplified via isGoodInitializerOrObject
@ -2949,8 +2949,8 @@ __pthread_mutex_lock (pthread_mutex_t *mutex)
return (*themutex)->Lock (); return (*themutex)->Lock ();
} }
int extern "C" int
__pthread_mutex_trylock (pthread_mutex_t *mutex) pthread_mutex_trylock (pthread_mutex_t *mutex)
{ {
pthread_mutex_t *themutex = mutex; pthread_mutex_t *themutex = mutex;
if (pthread_mutex::isGoodInitializer (mutex)) if (pthread_mutex::isGoodInitializer (mutex))
@ -2960,8 +2960,8 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex)
return (*themutex)->TryLock (); return (*themutex)->TryLock ();
} }
int extern "C" int
__pthread_mutex_unlock (pthread_mutex_t *mutex) pthread_mutex_unlock (pthread_mutex_t *mutex)
{ {
if (pthread_mutex::isGoodInitializer (mutex)) if (pthread_mutex::isGoodInitializer (mutex))
pthread_mutex::init (mutex, NULL); pthread_mutex::init (mutex, NULL);
@ -2970,8 +2970,8 @@ __pthread_mutex_unlock (pthread_mutex_t *mutex)
return (*mutex)->UnLock (); return (*mutex)->UnLock ();
} }
int extern "C" int
__pthread_mutex_destroy (pthread_mutex_t *mutex) pthread_mutex_destroy (pthread_mutex_t *mutex)
{ {
int rv; int rv;
@ -2988,8 +2988,8 @@ __pthread_mutex_destroy (pthread_mutex_t *mutex)
return 0; return 0;
} }
int extern "C" int
__pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling, pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling,
int *old_ceiling) int *old_ceiling)
{ {
pthread_mutex_t *themutex = mutex; 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 /* Win32 doesn't support mutex priorities - see __pthread_mutex_getprioceiling
for more detail */ for more detail */
int extern "C" int
__pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr,
int *protocol) int *protocol)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
@ -3011,8 +3011,8 @@ __pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr,
return ENOSYS; return ENOSYS;
} }
int extern "C" int
__pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr,
int *pshared) int *pshared)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
@ -3021,8 +3021,8 @@ __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr,
return 0; return 0;
} }
int extern "C" int
__pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type) pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -3031,8 +3031,8 @@ __pthread_mutexattr_gettype (const pthread_mutexattr_t *attr, int *type)
} }
/* FIXME: write and test process shared mutex's. */ /* FIXME: write and test process shared mutex's. */
int extern "C" int
__pthread_mutexattr_init (pthread_mutexattr_t *attr) pthread_mutexattr_init (pthread_mutexattr_t *attr)
{ {
if (pthread_mutexattr::isGoodObject (attr)) if (pthread_mutexattr::isGoodObject (attr))
return EBUSY; return EBUSY;
@ -3047,8 +3047,8 @@ __pthread_mutexattr_init (pthread_mutexattr_t *attr)
return 0; return 0;
} }
int extern "C" int
__pthread_mutexattr_destroy (pthread_mutexattr_t *attr) pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -3059,8 +3059,8 @@ __pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
/* Win32 doesn't support mutex priorities */ /* Win32 doesn't support mutex priorities */
int extern "C" int
__pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -3068,8 +3068,8 @@ __pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol)
} }
/* Win32 doesn't support mutex priorities */ /* Win32 doesn't support mutex priorities */
int extern "C" int
__pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr,
int prioceiling) int prioceiling)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
@ -3077,8 +3077,8 @@ __pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr,
return ENOSYS; return ENOSYS;
} }
int extern "C" int
__pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr,
int *prioceiling) int *prioceiling)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
@ -3086,8 +3086,8 @@ __pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr,
return ENOSYS; return ENOSYS;
} }
int extern "C" int
__pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
return EINVAL; return EINVAL;
@ -3100,9 +3100,9 @@ __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared)
return 0; return 0;
} }
/* see __pthread_mutex_gettype */ /* see pthread_mutex_gettype */
int extern "C" int
__pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type) pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type)
{ {
if (!pthread_mutexattr::isGoodObject (attr)) if (!pthread_mutexattr::isGoodObject (attr))
return EINVAL; return EINVAL;

View File

@ -658,97 +658,6 @@ public:
#define MT_INTERFACE user_data->threadinterface #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 // MT_SAFE
#endif // _CYGNUS_THREADS_ #endif // _CYGNUS_THREADS_