summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
authorbje <bje>1998-07-19 22:26:31 +0000
committerbje <bje>1998-07-19 22:26:31 +0000
commit5e84109c56a3a11dcdf0a42b77c9a910012f7061 (patch)
treecd9f653d744e2c2503340244b8cc5ff9a6676825 /pthread.h
parent2bc58279a6e8baf8b4001042a4eb07d29e36b9a7 (diff)
1998-07-20 Ben Elliston <bje@cygnus.com>
* pthread.h (_pthread_once_flag): Add new variable. (_pthread_once_lock): Add new mutex lock to ensure integrity of access to _pthread_once_flag.
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h8
1 files changed, 8 insertions, 0 deletions
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 */