From ed9fe4559ca16bd11a3ab7144951b97b9378608b Mon Sep 17 00:00:00 2001 From: Thomas Pfaff Date: Thu, 9 Jan 2003 20:40:44 +0000 Subject: Applied cond_init patch --- winsup/cygwin/thread.h | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'winsup/cygwin/thread.h') diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index d33750c6b..a4a4f1504 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -121,6 +121,16 @@ void AssertResourceOwner (int, int); #endif } +class nativeMutex +{ +public: + bool init (); + bool lock (); + void unlock (); +private: + HANDLE theHandle; +}; + class per_process; class pinfo; @@ -288,9 +298,9 @@ public: class pthread_mutex:public verifyable_object { public: - static bool isGoodObject(pthread_mutex_t const *); - static bool isGoodInitializer(pthread_mutex_t const *); - static bool isGoodInitializerOrObject(pthread_mutex_t const *); + static bool isGoodObject (pthread_mutex_t const *); + static bool isGoodInitializer (pthread_mutex_t const *); + static bool isGoodInitializerOrObject (pthread_mutex_t const *); static bool isGoodInitializerOrBadObject (pthread_mutex_t const *mutex); static void initMutex (); static int init (pthread_mutex_t *, const pthread_mutexattr_t *); @@ -309,15 +319,8 @@ public: pthread_mutex (pthread_mutexattr * = NULL); pthread_mutex (pthread_mutex_t *, pthread_mutexattr *); ~pthread_mutex (); + private: - class nativeMutex { - public: - bool init(); - bool lock(); - void unlock(); - private: - HANDLE theHandle; - }; static nativeMutex mutexInitializationLock; }; @@ -432,9 +435,13 @@ public: class pthread_cond:public verifyable_object { public: - static bool isGoodObject(pthread_cond_t const *); - static bool isGoodInitializer(pthread_cond_t const *); - static bool isGoodInitializerOrObject(pthread_cond_t const *); + static bool isGoodObject (pthread_cond_t const *); + static bool isGoodInitializer (pthread_cond_t const *); + static bool isGoodInitializerOrObject (pthread_cond_t const *); + static bool isGoodInitializerOrBadObject (pthread_cond_t const *); + static void initMutex (); + static int init (pthread_cond_t *, const pthread_condattr_t *); + int shared; LONG waiting; LONG ExitingWait; @@ -450,6 +457,9 @@ public: pthread_cond (pthread_condattr *); ~pthread_cond (); + +private: + static nativeMutex condInitializationLock; }; class pthread_once @@ -559,8 +569,6 @@ void *__pthread_getspecific (pthread_key_t key); /* Thead synchroniation */ int __pthread_cond_destroy (pthread_cond_t * cond); -int __pthread_cond_init (pthread_cond_t * cond, - const pthread_condattr_t * attr); int __pthread_cond_signal (pthread_cond_t * cond); int __pthread_cond_broadcast (pthread_cond_t * cond); int __pthread_condattr_init (pthread_condattr_t * condattr); -- cgit v1.2.3