diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-07-30 18:48:19 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-07-30 18:48:19 +0400 |
commit | a918549275fd4e07362ec55cbabdaaaa12697dec (patch) | |
tree | 59f84da70f0b24d1115e6b992d9d9b90af2a6104 /winsup | |
parent | f048a4a16f61132a00bc32bc92433134749a47ab (diff) |
* bsd_mutex.cc (_msleep): Reset event object and close it before
entering mutex. Turn order of conditional for better readability.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygserver/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygserver/bsd_mutex.cc | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog index 634812436..34063dbe8 100644 --- a/winsup/cygserver/ChangeLog +++ b/winsup/cygserver/ChangeLog @@ -1,3 +1,8 @@ +2004-07-30 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Reset event object and close it before + entering mutex. Turn order of conditional for better readability. + 2004-07-26 Corinna Vinschen <corinna@vinschen.de> * cygserver.conf: Describe relation between shmmaxpgs and SHMMAX. 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; } |