diff options
Diffstat (limited to 'winsup/cygserver/bsd_mutex.cc')
-rw-r--r-- | winsup/cygserver/bsd_mutex.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygserver/bsd_mutex.cc b/winsup/cygserver/bsd_mutex.cc index 1a01dd2ea..449e61449 100644 --- a/winsup/cygserver/bsd_mutex.cc +++ b/winsup/cygserver/bsd_mutex.cc @@ -222,10 +222,12 @@ _msleep (void *ident, struct mtx *mtx, int priority, panic ("wait in msleep (%s) failed, %E", wmesg); break; } + /* Dismiss event before entering mutex. */ + ResetEvent (evt); + CloseHandle (evt); set_priority (old_priority); - if (!(priority & PDROP) && mtx) + if (mtx && !(priority & PDROP)) mtx_lock (mtx); - CloseHandle (evt); return ret; } |