From edff26f320def7562009773ff8f258688d9860f6 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 14 Mar 2005 01:30:17 +0000 Subject: '' --- implement.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'implement.h') 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; -- cgit v1.2.3