From 02048eae9107e7a34169b9c3d429a15523c1cdd2 Mon Sep 17 00:00:00 2001 From: bje Date: Mon, 20 Jul 1998 06:36:49 +0000 Subject: 1998-07-20 Ben Elliston * pthread.h (_pthread_once_flag): Remove. (_pthread_once_lock): Remove. (pthread_once): Add function prototype. (pthread_once_t): Define this type. --- pthread.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pthread.h') diff --git a/pthread.h b/pthread.h index 773e696..974a163 100644 --- a/pthread.h +++ b/pthread.h @@ -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); -- cgit v1.2.3