diff options
author | rpj <rpj> | 2005-03-14 01:30:17 +0000 |
---|---|---|
committer | rpj <rpj> | 2005-03-14 01:30:17 +0000 |
commit | edff26f320def7562009773ff8f258688d9860f6 (patch) | |
tree | f168e02fed0e44cac3128f136e2a60b62ea443a1 /implement.h | |
parent | 9b477bedafd2450735b78cdedc7af5e090aa8934 (diff) |
''
Diffstat (limited to 'implement.h')
-rw-r--r-- | implement.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/implement.h b/implement.h index abba13c..69a70c6 100644 --- a/implement.h +++ b/implement.h @@ -318,12 +318,20 @@ struct pthread_rwlockattr_t_ int pshared; }; -enum ptw32_once_state { - PTW32_ONCE_CLEAR = 0x0, - PTW32_ONCE_DONE = 0x1, +/* + * Values stored in once_control->done. + * 'done' use to be just true or false, but we can add cancellability + * of the init_routine by re-using 'done' to store multiple flags + * without changing the ABI. Previously, the initial value of 'done' + * was FALSE (0), and the new initial value is still zero (0). + */ +enum { + PTW32_ONCE_CLEAR = 0x0, + PTW32_ONCE_DONE = 0x1, PTW32_ONCE_CANCELLED = 0x2 }; +/* Global cond+mutex for once_control management */ typedef struct { pthread_cond_t cond; pthread_mutex_t mtx; @@ -483,7 +491,7 @@ extern CRITICAL_SECTION ptw32_cond_list_lock; extern CRITICAL_SECTION ptw32_cond_test_init_lock; extern CRITICAL_SECTION ptw32_rwlock_test_init_lock; extern CRITICAL_SECTION ptw32_spinlock_test_init_lock; -extern CRITICAL_SECTION ptw32_once_event_lock; +extern ptw32_once_control_t ptw32_once_control; #ifdef _UWIN extern int pthread_count; |