From 1f8b30497dba80363a1e10af5dd7366156456a0e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 4 Oct 2004 19:44:05 +0000 Subject: * 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. --- winsup/cygserver/process.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'winsup/cygserver/process.h') diff --git a/winsup/cygserver/process.h b/winsup/cygserver/process.h index 75d0c72d3..16a5205e9 100644 --- a/winsup/cygserver/process.h +++ b/winsup/cygserver/process.h @@ -65,6 +65,9 @@ private: class process_cache; +#define hold() _hold(__FILE__,__LINE__) +#define release() _release(__FILE__,__LINE__) + class process { friend class process_cache; @@ -82,8 +85,15 @@ public: bool is_active () const { return _exit_status == STILL_ACTIVE; } - void hold () { EnterCriticalSection (&_access); } - void release () { LeaveCriticalSection (&_access); } + void _hold (const char *file, int line) { + _log (file, line, LOG_DEBUG, "Try hold(%lu)", _cygpid); + EnterCriticalSection (&_access); + _log (file, line, LOG_DEBUG, "holding (%lu)", _cygpid); + } + void _release (const char *file, int line) { + _log (file, line, LOG_DEBUG, "leaving (%lu)", _cygpid); + LeaveCriticalSection (&_access); + } bool add (cleanup_routine *); bool remove (const cleanup_routine *); -- cgit v1.2.3