diff options
author | Christopher Faylor <me@cgf.cx> | 2006-03-01 21:31:24 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-03-01 21:31:24 +0000 |
commit | 8d0f58ef3724fc248b8e26be1a84ceffd93039fe (patch) | |
tree | 81406508f536e926f53d364558a79af95333939d /winsup/cygwin/cygthread.cc | |
parent | ee93375872d33a3c4518cda416315f8ea844f5ab (diff) | |
download | cygnal-8d0f58ef3724fc248b8e26be1a84ceffd93039fe.tar.gz cygnal-8d0f58ef3724fc248b8e26be1a84ceffd93039fe.tar.bz2 cygnal-8d0f58ef3724fc248b8e26be1a84ceffd93039fe.zip |
* cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings.
* cygthread.cc (cygthread::callfunc): Revert below change. Make ev a manual
reset event again. so that it will be reset by WaitFor*Object as appropriate.
(cygthread::stub): Ditto.
(cygthread::terminate_thread): Reset ev if it was found to have been set.
Diffstat (limited to 'winsup/cygwin/cygthread.cc')
-rw-r--r-- | winsup/cygwin/cygthread.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index a365dcc5b..407454310 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -36,7 +36,7 @@ cygthread::callfunc (bool issimplestub) else { if (issimplestub) - ev = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); + ev = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL); pass_arg = alloca (arglen); memcpy (pass_arg, arg, arglen); SetEvent (ev); @@ -78,7 +78,7 @@ cygthread::stub (VOID *arg) debug_printf ("thread '%s', id %p, stack_ptr %p", info->name (), info->id, info->stack_ptr); if (!info->ev) { - info->ev = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); + info->ev = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL); info->thread_sync = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); } } @@ -303,8 +303,8 @@ cygthread::terminate_thread () if (!inuse || exiting) goto force_notterminated; - if (ev) - terminated = WaitForSingleObject (ev, 0) != WAIT_OBJECT_0; + if (ev && !(terminated = WaitForSingleObject (ev, 0) != WAIT_OBJECT_0)) + ResetEvent (ev); MEMORY_BASIC_INFORMATION m; memset (&m, 0, sizeof (m)); @@ -319,7 +319,12 @@ cygthread::terminate_thread () if (is_freerange) free (this); else - release (true); + { +#ifdef DEBUGGING + terminated = true; +#endif + release (true); + } goto out; |