diff options
author | bje <bje> | 1998-07-20 06:36:49 +0000 |
---|---|---|
committer | bje <bje> | 1998-07-20 06:36:49 +0000 |
commit | 02048eae9107e7a34169b9c3d429a15523c1cdd2 (patch) | |
tree | 12e8aafa8977b971bdaefcb0c7c50c3305ea97d5 /pthread.h | |
parent | dff26ac214732b73ae64a1ec34a9a9f3061fe8ca (diff) |
1998-07-20 Ben Elliston <bje@cygnus.com>
* pthread.h (_pthread_once_flag): Remove.
(_pthread_once_lock): Remove.
(pthread_once): Add function prototype.
(pthread_once_t): Define this type.
Diffstat (limited to 'pthread.h')
-rw-r--r-- | pthread.h | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef HANDLE pthread_t; typedef CRITICAL_SECTION pthread_mutex_t; typedef DWORD pthread_key_t; -typedef unsigned short pthread_once_t; typedef struct { enum { SIGNAL, BROADCAST, NUM_EVENTS }; @@ -43,8 +42,10 @@ typedef struct { typedef struct { void * ptr; } pthread_condattr_t; typedef struct { void * ptr; } pthread_mutexattr_t; -/* Initialisers. */ -#define PTHREAD_ONCE_INIT 0 +typedef struct { + unsigned short flag; + pthread_mutex_t lock; +} pthread_once_t; #ifdef __cplusplus extern "C" { @@ -63,6 +64,8 @@ int pthread_equal(pthread_t t1, pthread_t t2); int pthread_join(pthread_t thread, void ** valueptr); +int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)); + /* Functions for manipulating thread attribute objects. */ int pthread_attr_init(pthread_attr_t *attr); |