4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-18 23:12:15 +08:00

* 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.
This commit is contained in:
Christopher Faylor 2003-12-07 02:56:52 +00:00
parent fcc47fd001
commit 73262d7a44
3 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2003-12-06 Christopher Faylor <cgf@redhat.com>
* 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.
2003-12-06 Christopher Faylor <cgf@redhat.com> 2003-12-06 Christopher Faylor <cgf@redhat.com>
* exceptions.cc (_threadinfo::remove): Avoid returning without * exceptions.cc (_threadinfo::remove): Avoid returning without

View File

@ -46,6 +46,7 @@ struct _threadinfo
void init_thread (void *); void init_thread (void *);
static void call (void (*) (void *, void *), void *); static void call (void (*) (void *, void *), void *);
void call2 (void (*) (void *, void *), void *, void *); void call2 (void (*) (void *, void *), void *, void *);
static struct _threadinfo *find_tls (int sig);
void remove (); void remove ();
void push (__stack_t, bool = false); void push (__stack_t, bool = false);
__stack_t pop (); __stack_t pop ();

View File

@ -988,11 +988,13 @@ set_signal_mask (sigset_t newmask, sigset_t& oldmask)
} }
_threadinfo * _threadinfo *
find_tls (int sig) _threadinfo::find_tls (int sig)
{ {
EnterCriticalSection (&protect_linked_list);
for (_threadinfo *t = _last_thread; t ; t = t->prev) for (_threadinfo *t = _last_thread; t ; t = t->prev)
if (sigismember (&t->sigwait_mask, sig)) if (sigismember (&t->sigwait_mask, sig))
return t; return t;
LeaveCriticalSection (&protect_linked_list);
return NULL; return NULL;
} }
@ -1023,7 +1025,7 @@ sig_handle (int sig, sigset_t mask, int pid, _threadinfo *tls)
|| ISSTATE (myself, PID_STOPPED))) || ISSTATE (myself, PID_STOPPED)))
{ {
sigproc_printf ("signal %d blocked", sig); 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; goto thread_specific;
rc = -1; rc = -1;
goto done; goto done;