Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/thread.h')
-rw-r--r--winsup/cygwin/thread.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index f8ab9da8b..c15ded478 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -301,21 +301,27 @@ public:
int type;
int pshared;
+ pthread_t get_pthread_self () const
+ {
+ return PTHREAD_MUTEX_NORMAL == type ? MUTEX_OWNER_ANONYMOUS :
+ ::pthread_self ();
+ }
+
int lock ()
{
- return _lock (::pthread_self ());
+ return _lock (get_pthread_self ());
}
int trylock ()
{
- return _trylock (::pthread_self ());
+ return _trylock (get_pthread_self ());
}
int unlock ()
{
- return _unlock (::pthread_self ());
+ return _unlock (get_pthread_self ());
}
int destroy ()
{
- return _destroy (::pthread_self ());
+ return _destroy (get_pthread_self ());
}
void set_owner (pthread_t self)