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>
+
* exceptions.cc (_threadinfo::remove): Avoid returning without
unlocking critical section in the (hopefully impossible) case of an
unrecognized thread.
void init_thread (void *);
static void call (void (*) (void *, void *), void *);
void call2 (void (*) (void *, void *), void *, void *);
+ static struct _threadinfo *find_tls (int sig);
void remove ();
void push (__stack_t, bool = false);
__stack_t pop ();
}
_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;
}
|| 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;