summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
authorrpj <rpj>1999-02-12 08:19:34 +0000
committerrpj <rpj>1999-02-12 08:19:34 +0000
commit44f6c8a35ca491b1f04d6b460ab5d0d8a3cf6083 (patch)
tree43343d58f15346fea6d09371c7d6abb090fa8842 /pthread.h
parenteb222bd25ddfc39ac156d59331f1dd4c3ef5df9b (diff)
Sat Feb 13 03:03:30 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* pthread.h (struct pthread_once_t_): Replaced. * misc.c (pthread_once): Replace with John Bossom's version; has lighter weight serialisation; fixes problem of not holding competing threads until after the init_routine completes.
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/pthread.h b/pthread.h
index 415602c..d08eac3 100644
--- a/pthread.h
+++ b/pthread.h
@@ -491,8 +491,14 @@ extern "C"
* ====================
* ====================
*/
-#define PTHREAD_ONCE_INIT { 0, PTHREAD_MUTEX_INITIALIZER }
+#define PTHREAD_ONCE_INIT { FALSE, -1 }
+struct pthread_once_t_
+{
+ int done; /* indicates if user function executed */
+ long started; /* First thread to increment this value */
+ /* to zero executes the user function */
+};
/*
* ====================