diff options
author | Christopher Faylor <me@cgf.cx> | 2000-02-24 19:54:01 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-02-24 19:54:01 +0000 |
commit | d3bda1df95dd1e368ec03b1a1b9e3f0260b4cbfc (patch) | |
tree | fae6cee1f065d106fc2fe2e731d238973b4125fc /winsup/cygwin/exceptions.cc | |
parent | 4bc3b73cfde68ab05ce7351cf57156ece6433548 (diff) | |
download | cygnal-d3bda1df95dd1e368ec03b1a1b9e3f0260b4cbfc.tar.gz cygnal-d3bda1df95dd1e368ec03b1a1b9e3f0260b4cbfc.tar.bz2 cygnal-d3bda1df95dd1e368ec03b1a1b9e3f0260b4cbfc.zip |
* exceptions.cc (call_handler): Use new muto linked list to look for all
potential mutos owned by suspended thread. Clear waiting threads while thread
is stopped.
(proc_subproc): Clarify debugging output.
* sync.h (class muto): Add 'next' field.
(new_muto): Keep linked list alive.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 4176f66cc..3213aa972 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -713,7 +713,6 @@ call_handler (int sig, struct sigaction& siga, void *handler) CONTEXT *cx, orig; int interrupted = 1; int res; - extern muto *sync_proc_subproc; if (hExeced != NULL && hExeced != INVALID_HANDLE_VALUE) { @@ -743,10 +742,13 @@ call_handler (int sig, struct sigaction& siga, void *handler) goto set_pending; /* FIXME: Make multi-thread aware */ - if (!sync_proc_subproc->unstable () && sync_proc_subproc->owner () != maintid && - !mask_sync->unstable () && mask_sync->owner () != maintid) - break; + for (muto *m = muto_start.next; m != NULL; m = m->next) + if (m->unstable () || m->owner () == maintid) + goto keep_looping; + + break; + keep_looping: ResumeThread (hth); Sleep (0); } @@ -781,12 +783,16 @@ call_handler (int sig, struct sigaction& siga, void *handler) interrupted = 0; } - (void) ResumeThread (hth); - if (interrupted) { /* Clear any waiting threads prior to dispatching to handler function */ proc_subproc(PROC_CLEARWAIT, 1); + } + + (void) ResumeThread (hth); + + if (interrupted) + { /* Apparently we have to set signal_arrived after resuming the thread or it is possible that the event will be ignored. */ (void) SetEvent (signal_arrived); // For an EINTR case |