diff -urp src.old/winsup/cygwin/pthread.cc src/winsup/cygwin/pthread.cc --- src.old/winsup/cygwin/pthread.cc 2003-03-19 14:21:44.000000000 +0100 +++ src/winsup/cygwin/pthread.cc 2003-03-19 14:30:27.000000000 +0100 @@ -55,6 +55,11 @@ pthread_detach (pthread_t thread) return pthread::detach (&thread); } +int +pthread_equal (pthread_t t1, pthread_t t2) +{ + return pthread::equal (t1, t2); +} /* This isn't a posix call... should we keep it? */ int diff -urp src.old/winsup/cygwin/thread.cc src/winsup/cygwin/thread.cc --- src.old/winsup/cygwin/thread.cc 2003-03-19 14:29:53.000000000 +0100 +++ src/winsup/cygwin/thread.cc 2003-03-19 14:30:27.000000000 +0100 @@ -397,7 +397,7 @@ pthread::exit (void *value_ptr) mutex.Lock (); // cleanup if thread is in detached state and not joined - if (pthread_equal (joiner, thread)) + if (equal (joiner, thread)) delete this; else { @@ -428,7 +428,7 @@ pthread::cancel (void) return 0; } - else if (pthread_equal (thread, self)) + else if (equal (thread, self)) { mutex.UnLock (); cancel_self (); @@ -1525,7 +1525,7 @@ pthread_mutex::canBeUnlocked (pthread_mu /* * Check if the mutex is owned by the current thread and can be unlocked */ - return (pthread_equal ((*mutex)->owner, self)) && 1 == (*mutex)->recursion_counter; + return (pthread::equal ((*mutex)->owner, self)) && 1 == (*mutex)->recursion_counter; } /* This is used for mutex creation protection within a single process only */ @@ -1598,7 +1598,7 @@ pthread_mutex::_Lock (pthread_t self) if (1 == InterlockedIncrementUL (&lock_counter)) SetOwner (self); - else if (PTHREAD_MUTEX_NORMAL != type && pthread_equal (owner, self)) + else if (PTHREAD_MUTEX_NORMAL != type && pthread::equal (owner, self)) { InterlockedDecrementUL (&lock_counter); if (PTHREAD_MUTEX_RECURSIVE == type) @@ -1622,7 +1622,7 @@ pthread_mutex::_TryLock (pthread_t self) if (0 == InterlockedCompareExchangeUL (&lock_counter, 1, 0 )) SetOwner (self); - else if (PTHREAD_MUTEX_RECURSIVE == type && pthread_equal (owner, self)) + else if (PTHREAD_MUTEX_RECURSIVE == type && pthread::equal (owner, self)) result = LockRecursive (); else result = EBUSY; @@ -1633,7 +1633,7 @@ pthread_mutex::_TryLock (pthread_t self) int pthread_mutex::_UnLock (pthread_t self) { - if (!pthread_equal (owner, self)) + if (!pthread::equal (owner, self)) return EPERM; if (0 == --recursion_counter) @@ -2236,7 +2236,7 @@ pthread::join (pthread_t *thread, void * if (!isGoodObject (thread)) return ESRCH; - if (pthread_equal (*thread,joiner)) + if (equal (*thread,joiner)) return EDEADLK; (*thread)->mutex.Lock (); @@ -2857,14 +2857,6 @@ pthread_sigmask (int operation, const si return rval; } -/* ID */ - -int -pthread_equal (pthread_t t1, pthread_t t2) -{ - return t1 == t2; -} - /* Mutexes */ /* FIXME: there's a potential race with PTHREAD_MUTEX_INITALIZER: diff -urp src.old/winsup/cygwin/thread.h src/winsup/cygwin/thread.h --- src.old/winsup/cygwin/thread.h 2003-03-19 14:21:35.000000000 +0100 +++ src/winsup/cygwin/thread.h 2003-03-19 14:30:27.000000000 +0100 @@ -435,6 +435,11 @@ public: virtual unsigned long getsequence_np(); + static int equal (pthread_t t1, pthread_t t2) + { + return t1 == t2; + } + private: DWORD thread_id; __pthread_cleanup_handler *cleanup_stack;