From cd3c708380761302fb5ffc6531d396f71b706b4f Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 3 Jun 2005 08:36:26 +0000 Subject: '' --- implement.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'implement.h') diff --git a/implement.h b/implement.h index 670d948..3d96483 100644 --- a/implement.h +++ b/implement.h @@ -324,16 +324,21 @@ struct pthread_rwlockattr_t_ int pshared; }; -enum ptw32_once_state { - PTW32_ONCE_INIT = 0x0, - PTW32_ONCE_STARTED = 0x1, - PTW32_ONCE_DONE = 0x2 +/* + * MCS lock queue node - see ptw32_MCS_lock.c + */ +struct ptw32_mcs_node_t_ +{ + struct ptw32_mcs_node_t_ **lock; /* ptr to tail of queue */ + struct ptw32_mcs_node_t_ *next; /* ptr to successor in queue */ + LONG readyFlag; /* set after lock is released by + predecessor */ + LONG nextFlag; /* set after 'next' ptr is set by + successor */ }; -typedef struct { - pthread_cond_t cond; - pthread_mutex_t mtx; -} ptw32_once_control_t; +typedef struct ptw32_mcs_node_t_ ptw32_mcs_local_node_t; +typedef struct ptw32_mcs_node_t_ *ptw32_mcs_lock_t; struct ThreadKeyAssoc @@ -612,6 +617,10 @@ extern "C" DWORD ptw32_relmillisecs (const struct timespec * abstime); + void ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node); + + void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node); + #ifdef NEED_FTIME void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft); void ptw32_filetime_to_timespec (const FILETIME * ft, struct timespec *ts); -- cgit v1.2.3