diff options
author | Christopher Faylor <me@cgf.cx> | 2005-10-03 17:23:54 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-10-03 17:23:54 +0000 |
commit | fa35a1ee5c602b765ca8a2886b2062971f871c47 (patch) | |
tree | 74af3f7a62b54047beedf3b65b26a1e3157411e6 /winsup/cygwin/pinfo.cc | |
parent | 8afb8202d457c054d411988ffd980eea466045a9 (diff) | |
download | cygnal-fa35a1ee5c602b765ca8a2886b2062971f871c47.tar.gz cygnal-fa35a1ee5c602b765ca8a2886b2062971f871c47.tar.bz2 cygnal-fa35a1ee5c602b765ca8a2886b2062971f871c47.zip |
* cygheap.h (class process_lock): New class.
* dtable.h (class dtable): Add class process_lock as a friend.
* dcrt0.cc (get_exit_lock): Delete.
(do_exit): Use process_lock class instead of get_exit_lock.
* exceptions.cc (signal_exit): Ditto.
* pinfo.cc (pinfo::exit): Ditto.
(_pinfo::commune_process): Set process lock around this whole function.
(_pinfo::commune_request): Use process_lock rather than myself.lock.
* pinfo.h (pinfo::_lock): Delete.
(pinfo::initialize_lock): Delete.
(pinfo::lock): Delete.
(pinfo::unlock): Delete.
* winsup.h (get_exit_lock): Delete declaration.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index e77a4e6a3..5df86c730 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -59,7 +59,6 @@ set_myself (HANDLE h) #endif strace.hello (); debug_printf ("myself->dwProcessId %u", myself->dwProcessId); - myself.initialize_lock (); if (h) { /* here if execed */ @@ -140,7 +139,7 @@ pinfo::zap_cwd () void pinfo::exit (DWORD n) { - get_exit_lock (); + process_lock until_exit (); cygthread::terminate (); if (n != EXITCODE_NOSET) self->exitcode = EXITCODE_SET | n;/* We're really exiting. Record the UNIX exit code. */ @@ -390,6 +389,8 @@ _pinfo::commune_process (siginfo_t& si) if (process_sync) // FIXME: this test shouldn't be necessary ProtectHandle (process_sync); + process_lock now (false); + switch (si._si_commune._si_code) { case PICOM_CMDLINE: @@ -586,7 +587,7 @@ _pinfo::commune_request (__uint32_t code, ...) break; } - myself.lock (); + process_lock now (); locked = true; char name_buf[CYG_MAX_PATH]; request_sync = CreateSemaphore (&sec_none_nih, 0, LONG_MAX, @@ -665,8 +666,6 @@ out: ReleaseSemaphore (request_sync, 1, &res); ForceCloseHandle (request_sync); } - if (locked) - myself.unlock (); if (hp) CloseHandle (hp); if (fromthem) |