* cygheap.cc (init_cygheap::find_tls): Don't consider unitialized threads.
* cygtls.cc (_cygtls::operator HANDLE): Return NULL when tid is not set. * exceptions.cc (setup_handler): Don't try to suspend a thread if it has no handle.
This commit is contained in:
@@ -628,14 +628,16 @@ init_cygheap::find_tls (int sig)
|
||||
{
|
||||
threadlist_ix = -1;
|
||||
while (++threadlist_ix < (int) nthreads)
|
||||
if (sigismember (&(threadlist[threadlist_ix]->sigwait_mask), sig))
|
||||
if (threadlist[threadlist_ix]->tid
|
||||
&& sigismember (&(threadlist[threadlist_ix]->sigwait_mask), sig))
|
||||
{
|
||||
t = cygheap->threadlist[threadlist_ix];
|
||||
goto out;
|
||||
}
|
||||
threadlist_ix = -1;
|
||||
while (++threadlist_ix < (int) nthreads)
|
||||
if (!sigismember (&(threadlist[threadlist_ix]->sigmask), sig))
|
||||
if (threadlist[threadlist_ix]->tid
|
||||
&& !sigismember (&(threadlist[threadlist_ix]->sigmask), sig))
|
||||
{
|
||||
t = cygheap->threadlist[threadlist_ix];
|
||||
break;
|
||||
|
Reference in New Issue
Block a user