From b95ae5046127940693f0a819dcedb08e383011da Mon Sep 17 00:00:00 2001 From: Thomas Pfaff Date: Thu, 4 Mar 2004 21:04:14 +0000 Subject: * include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): New define. (PTHREAD_NORMAL_MUTEX_INITIALIZER_NP): Ditto. (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Ditto. * thread.cc (pthread_mutex::is_good_initializer): Check for all posssible initializers (pthread_mutex::is_good_initializer_or_object): Ditto. (pthread_mutex::is_good_initializer_or_bad_object): Ditto. (verifyable_object_isvalid): Support up to three static initializers. (verifyable_object_isvalid (void const *,long)): Remove. (pthread_cond::is_good_initializer_or_bad_object): Remove unneeded objectState var. (pthread_cond::init): Condition remains unchanged when creation has failed. (pthread_rwlock::is_good_initializer_or_bad_object): Remove unneeded objectState var. (pthread_rwlock::init): Rwlock remains unchanged when creation has failed. (pthread_mutex::init): Remove obsolete comment. Mutex remains unchanged when creation has failed. Add support for new initializers. (pthread_mutex_getprioceiling): Do not create mutex, just return ENOSYS. (pthread_mutex_lock): Simplify. (pthread_mutex_trylock): Remove unneeded local themutex. (pthread_mutex_unlock): Just return EPERM if mutex is not initialized. (pthread_mutex_setprioceiling): Do not create mutex, just return ENOSYS. * thread.h (verifyable_object_isvalid): Support up to three static initializers. (verifyable_object_isvalid (void const *,long)): Remove prototype. (pthread_mutex::init): Add optional initializer to parameter list. --- winsup/cygwin/thread.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/thread.h') diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index e5a0bccee..02eac1899 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -120,8 +120,10 @@ typedef enum VALID_STATIC_OBJECT } verifyable_object_state; -verifyable_object_state verifyable_object_isvalid (void const *, long); -verifyable_object_state verifyable_object_isvalid (void const *, long, void *); +verifyable_object_state verifyable_object_isvalid (void const * objectptr, long magic, + void *static_ptr1 = NULL, + void *static_ptr2 = NULL, + void *static_ptr3 = NULL); template inline void List_insert (list_node *&head, list_node *node) @@ -276,7 +278,8 @@ public: static bool is_good_initializer_or_bad_object (pthread_mutex_t const *mutex); static bool can_be_unlocked (pthread_mutex_t const *mutex); static void init_mutex (); - static int init (pthread_mutex_t *, const pthread_mutexattr_t *); + static int init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr, + const pthread_mutex_t initializer = NULL); unsigned long lock_counter; HANDLE win32_obj_id; -- cgit v1.2.3