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/process.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/process.cc')
-rw-r--r-- | winsup/cygserver/process.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/winsup/cygserver/process.cc b/winsup/cygserver/process.cc index 94e7893a2..e03370d11 100644 --- a/winsup/cygserver/process.cc +++ b/winsup/cygserver/process.cc @@ -69,10 +69,12 @@ process::process (const pid_t cygpid, const DWORD winpid, HANDLE signal_arrived) GetLastError ()); } InitializeCriticalSection (&_access); + debug ("initialized (%lu)", _cygpid); } process::~process () { + debug ("deleting (%lu)", _cygpid); DeleteCriticalSection (&_access); CloseHandle (_signal_arrived); CloseHandle (_hProcess); @@ -105,7 +107,7 @@ process::add (cleanup_routine *const entry) assert (entry); bool res = false; - EnterCriticalSection (&_access); + hold (); if (!_cleaning_up) { @@ -114,7 +116,7 @@ process::add (cleanup_routine *const entry) res = true; } - LeaveCriticalSection (&_access); + release (); return res; } @@ -124,7 +126,7 @@ process::remove (const cleanup_routine *const entry) assert (entry); bool res = false; - EnterCriticalSection (&_access); + hold (); if (!_cleaning_up) { @@ -148,7 +150,7 @@ process::remove (const cleanup_routine *const entry) } } - LeaveCriticalSection (&_access); + release (); return res; } @@ -159,13 +161,13 @@ process::remove (const cleanup_routine *const entry) void process::cleanup () { - EnterCriticalSection (&_access); + hold (); assert (!is_active ()); assert (!_cleaning_up); InterlockedExchange (&_cleaning_up, true); cleanup_routine *entry = _routines_head; _routines_head = NULL; - LeaveCriticalSection (&_access); + release (); while (entry) { @@ -275,7 +277,7 @@ process_cache::process (const pid_t cygpid, const DWORD winpid, SetEvent (_cache_add_trigger); } - EnterCriticalSection (&entry->_access); // To be released by the caller. + entry->hold (); // To be released by the caller. LeaveCriticalSection (&_cache_write_access); assert (entry); assert (entry->_winpid == winpid); |