Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-10-04 23:44:05 +0400
committerCorinna Vinschen <corinna@vinschen.de>2004-10-04 23:44:05 +0400
commit1f8b30497dba80363a1e10af5dd7366156456a0e (patch)
treea8d17990e1eae19f29c620f1e49112cc1fc33afd /winsup/cygserver/process.h
parent3ea9de7644c3110f6f8394501cd26a38852c95e9 (diff)
* 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.h')
-rw-r--r--winsup/cygserver/process.h14
1 files changed, 12 insertions, 2 deletions
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 *);