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:
authorChristopher Faylor <me@cgf.cx>2003-12-07 05:56:52 +0300
committerChristopher Faylor <me@cgf.cx>2003-12-07 05:56:52 +0300
commit73262d7a44b90e2338fe031ebeaa17c7a299d547 (patch)
treed3de2229068da0c0aaf0b20eb206858f67871148 /winsup/cygwin/exceptions.cc
parentfcc47fd0013d63dfe43b81ec26ad10eea5a05cbe (diff)
* cygtls.h (_threadinfo::find_tls): New function.
* exceptions.cc (_threadinfo::find_tls): Rename from find_tls. Use critical section to protect access to linked list.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index aba96ecb0..ea2c7e6d5 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -988,11 +988,13 @@ set_signal_mask (sigset_t newmask, sigset_t& oldmask)
}
_threadinfo *
-find_tls (int sig)
+_threadinfo::find_tls (int sig)
{
+ EnterCriticalSection (&protect_linked_list);
for (_threadinfo *t = _last_thread; t ; t = t->prev)
if (sigismember (&t->sigwait_mask, sig))
return t;
+ LeaveCriticalSection (&protect_linked_list);
return NULL;
}
@@ -1023,7 +1025,7 @@ sig_handle (int sig, sigset_t mask, int pid, _threadinfo *tls)
|| ISSTATE (myself, PID_STOPPED)))
{
sigproc_printf ("signal %d blocked", sig);
- if (insigwait_mask || (tls = find_tls (sig)) != NULL)
+ if (insigwait_mask || (tls = _threadinfo::find_tls (sig)) != NULL)
goto thread_specific;
rc = -1;
goto done;