summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h9
1 files changed, 6 insertions, 3 deletions
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);