diff options
author | Christopher Faylor <me@cgf.cx> | 2001-03-17 01:14:58 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-03-17 01:14:58 +0000 |
commit | 5ccbf4b6998788d90b317b2c27f93efc2eca1516 (patch) | |
tree | 464959f9a7111b7931514d9129c292f5cb5a231d /winsup/cygwin/include/pthread.h | |
parent | 8308bf58f71b692b85944f5ec8a58168779a142c (diff) | |
download | newlib-5ccbf4b6998788d90b317b2c27f93efc2eca1516.zip newlib-5ccbf4b6998788d90b317b2c27f93efc2eca1516.tar.gz newlib-5ccbf4b6998788d90b317b2c27f93efc2eca1516.tar.bz2 |
* cygwin.din: Export the new functions.
* pthread.cc (pthread_cond_*): Add wrapper functions that call __pthread_cond*
functions.
* thread.cc (__pthread_cond_*): Implement the pthread_cond* functions.
* thread.h: Add new class entries and prototypes for __pthread_cond* functions.
* include/pthread.h: user land header prototypes for pthread_cond* functions
and related defines.
Diffstat (limited to 'winsup/cygwin/include/pthread.h')
-rw-r--r-- | winsup/cygwin/include/pthread.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/winsup/cygwin/include/pthread.h b/winsup/cygwin/include/pthread.h index 90bf5c2..1a96e72 100644 --- a/winsup/cygwin/include/pthread.h +++ b/winsup/cygwin/include/pthread.h @@ -23,6 +23,16 @@ extern "C" #define TFD(n) void*(*n)(void*) +/* Defines. (These are correctly defined here as per + http://www.opengroup.org/onlinepubs/7908799/xsh/pthread.h.html */ + +/* FIXME: this should allocate a new cond variable, and return the value that + would normally be written to the passed parameter of pthread_cond_init(lvalue, NULL); */ +// #define PTHREAD_COND_INITIALIZER 0 + +#define PTHREAD_PROCESS_PRIVATE 0 +#define PTHREAD_PROCESS_SHARED 1 + typedef int pthread_t; typedef int pthread_mutex_t; typedef int sem_t; @@ -43,6 +53,15 @@ typedef struct pthread_mutexattr } pthread_mutexattr_t; +typedef struct pthread_condattr + { + int shared; + int valid; + } +pthread_condattr_t; + +typedef int pthread_cond_t; + /* ThreadCreation */ int pthread_create (pthread_t * thread, const pthread_attr_t * attr, TFD (function), void *arg); int pthread_attr_init (pthread_attr_t * attr); @@ -50,6 +69,20 @@ int pthread_attr_destroy (pthread_attr_t * attr); int pthread_attr_setstacksize (pthread_attr_t * attr, size_t size); int pthread_attr_getstacksize (pthread_attr_t * attr, size_t * size); +/* Condition variables */ +int pthread_cond_broadcast(pthread_cond_t *); +int pthread_cond_destroy(pthread_cond_t *); +int pthread_cond_init(pthread_cond_t *, const pthread_condattr_t *); +int pthread_cond_signal(pthread_cond_t *); +int pthread_cond_timedwait(pthread_cond_t *, + pthread_mutex_t *, const struct timespec *); +int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *); +int pthread_condattr_destroy(pthread_condattr_t *); +int pthread_condattr_getpshared(const pthread_condattr_t *, int *); +int pthread_condattr_init(pthread_condattr_t *); +int pthread_condattr_setpshared(pthread_condattr_t *, int); + + /* Thread Control */ int pthread_detach (pthread_t thread); int pthread_join (pthread_t thread, void **value_ptr); |