From 5e84109c56a3a11dcdf0a42b77c9a910012f7061 Mon Sep 17 00:00:00 2001 From: bje Date: Sun, 19 Jul 1998 22:26:31 +0000 Subject: 1998-07-20 Ben Elliston * pthread.h (_pthread_once_flag): Add new variable. (_pthread_once_lock): Add new mutex lock to ensure integrity of access to _pthread_once_flag. --- pthread.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pthread.h') diff --git a/pthread.h b/pthread.h index abce374..773e696 100644 --- a/pthread.h +++ b/pthread.h @@ -25,6 +25,7 @@ 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 }; @@ -42,6 +43,9 @@ typedef struct { typedef struct { void * ptr; } pthread_condattr_t; typedef struct { void * ptr; } pthread_mutexattr_t; +/* Initialisers. */ +#define PTHREAD_ONCE_INIT 0 + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -182,10 +186,14 @@ struct _pthread_threads_thread { pthread_mutex_t _pthread_count_mutex = PTHREAD_MUTEX_INITIALIZER; DWORD _pthread_threads_count = 0; _pthread_threads_thread_t _pthread_threads_table[PTHREAD_THREADS_MAX]; +unsigned short _pthread_once_flag; +pthread_mutex_t _pthread_once_lock = PTHREAD_MUTEX_INITIALIZER; #else extern pthread_mutex_t _pthread_count_mutex; extern DWORD _pthread_threads_count; extern _pthread_threads_thread_t _pthread_threads_table[]; +extern unsigned short _pthread_once_flag; +pthread_mutex_t _pthread_once_lock; #endif /* End of application static data */ -- cgit v1.2.3