diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-10-04 19:44:05 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-10-04 19:44:05 +0000 |
commit | 1f8b30497dba80363a1e10af5dd7366156456a0e (patch) | |
tree | a8d17990e1eae19f29c620f1e49112cc1fc33afd /winsup/cygserver/bsd_mutex.cc | |
parent | 3ea9de7644c3110f6f8394501cd26a38852c95e9 (diff) | |
download | cygnal-1f8b30497dba80363a1e10af5dd7366156456a0e.tar.gz cygnal-1f8b30497dba80363a1e10af5dd7366156456a0e.tar.bz2 cygnal-1f8b30497dba80363a1e10af5dd7366156456a0e.zip |
* bsd_mutex.cc (_msleep): Simplify event creation. Revert change from
2004-08-24. It should be unnecessary now.
* msg.cc (client_request_msg::serve): Release process critical
section as early as possible.
* sem.cc (client_request_sem::serve): Ditto.
* shm.cc (client_request_shm::serve): Ditto.
* process.cc: Use hold and release method calls instead of
EnterCriticalSection/LeaveCriticalSection calls throughout.
* process.h (_hold): Rename from hold. Take filename and linenumber
parameter for logging. Define matching hold macro.
(release): Ditto.
Diffstat (limited to 'winsup/cygserver/bsd_mutex.cc')
-rw-r--r-- | winsup/cygserver/bsd_mutex.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/winsup/cygserver/bsd_mutex.cc b/winsup/cygserver/bsd_mutex.cc index ad3c4a99d..873891458 100644 --- a/winsup/cygserver/bsd_mutex.cc +++ b/winsup/cygserver/bsd_mutex.cc @@ -180,9 +180,7 @@ _msleep (void *ident, struct mtx *mtx, int priority, int ret = -1; char name[64]; msleep_event_name (ident, name); - HANDLE evt = OpenEvent (EVENT_ALL_ACCESS, FALSE, name); - if (!evt) - evt = CreateEvent (NULL, TRUE, FALSE, name); + HANDLE evt = CreateEvent (NULL, TRUE, FALSE, name); if (!evt) panic ("CreateEvent in msleep (%s) failed: %E", wmesg); if (mtx) @@ -201,7 +199,6 @@ _msleep (void *ident, struct mtx *mtx, int priority, if ((priority & PCATCH) && td->client->signal_arrived () != INVALID_HANDLE_VALUE) obj_cnt = 4; - td->client->release (); switch (WaitForMultipleObjects (obj_cnt, obj, FALSE, timo ?: INFINITE)) { case WAIT_OBJECT_0: /* wakeup() has been called. */ @@ -233,7 +230,6 @@ _msleep (void *ident, struct mtx *mtx, int priority, ResetEvent (evt); #endif CloseHandle (evt); - td->client->hold (); set_priority (old_priority); if (mtx && !(priority & PDROP)) mtx_lock (mtx); |