* 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.
This commit is contained in:
Corinna Vinschen
2004-10-04 19:44:05 +00:00
parent 3ea9de7644
commit 1f8b30497d
7 changed files with 43 additions and 17 deletions

View File

@ -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 *);