* cygtls.cc (_cygtls::remove): Call remove_wq even when we can't necessarily
get the cygtls table lock. * cygtls.h (_cygtls::remove_wq): Add wait argument. * sigproc.cc (_cygtls::remove_wq): Honor wait argument when acquiring lock. (proc_terminate): Don't NULL sync_proc_subproc since other threads may still try to access it.
This commit is contained in:
parent
6644f5097c
commit
168d7785fc
|
@ -1,3 +1,13 @@
|
||||||
|
2004-03-14 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* cygtls.cc (_cygtls::remove): Call remove_wq even when we can't
|
||||||
|
necessarily get the cygtls table lock.
|
||||||
|
* cygtls.h (_cygtls::remove_wq): Add wait argument.
|
||||||
|
* sigproc.cc (_cygtls::remove_wq): Honor wait argument when acquiring
|
||||||
|
lock.
|
||||||
|
(proc_terminate): Don't NULL sync_proc_subproc since other threads may
|
||||||
|
still try to access it.
|
||||||
|
|
||||||
2004-03-12 Corinna Vinschen <corinna@vinschen.de>
|
2004-03-12 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* errno.cc (errmap): Map ERROR_BEGINNING_OF_MEDIA and
|
* errno.cc (errmap): Map ERROR_BEGINNING_OF_MEDIA and
|
||||||
|
|
|
@ -150,6 +150,8 @@ void
|
||||||
_cygtls::remove (DWORD wait)
|
_cygtls::remove (DWORD wait)
|
||||||
{
|
{
|
||||||
debug_printf ("wait %p\n", wait);
|
debug_printf ("wait %p\n", wait);
|
||||||
|
do
|
||||||
|
{
|
||||||
sentry here (wait);
|
sentry here (wait);
|
||||||
if (here.acquired ())
|
if (here.acquired ())
|
||||||
{
|
{
|
||||||
|
@ -159,10 +161,11 @@ _cygtls::remove (DWORD wait)
|
||||||
if (i < --nthreads)
|
if (i < --nthreads)
|
||||||
cygheap->threadlist[i] = cygheap->threadlist[nthreads];
|
cygheap->threadlist[i] = cygheap->threadlist[nthreads];
|
||||||
debug_printf ("removed %p element %d", this, i);
|
debug_printf ("removed %p element %d", this, i);
|
||||||
remove_wq ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} while (0);
|
||||||
|
remove_wq (wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -154,7 +154,7 @@ struct _cygtls
|
||||||
void set_threadkill () {threadkill = true;}
|
void set_threadkill () {threadkill = true;}
|
||||||
void reset_threadkill () {threadkill = false;}
|
void reset_threadkill () {threadkill = false;}
|
||||||
int call_signal_handler () __attribute__ ((regparm (1)));
|
int call_signal_handler () __attribute__ ((regparm (1)));
|
||||||
void remove_wq () __attribute__ ((regparm (1)));
|
void remove_wq (DWORD) __attribute__ ((regparm (1)));
|
||||||
void fixup_after_fork () __attribute__ ((regparm (1)));
|
void fixup_after_fork () __attribute__ ((regparm (1)));
|
||||||
void lock () __attribute__ ((regparm (1)));
|
void lock () __attribute__ ((regparm (1)));
|
||||||
void unlock () __attribute__ ((regparm (1)));
|
void unlock () __attribute__ ((regparm (1)));
|
||||||
|
|
|
@ -471,9 +471,10 @@ out1:
|
||||||
|
|
||||||
// FIXME: This is inelegant
|
// FIXME: This is inelegant
|
||||||
void
|
void
|
||||||
_cygtls::remove_wq ()
|
_cygtls::remove_wq (DWORD wait)
|
||||||
|
{
|
||||||
|
if (sync_proc_subproc && sync_proc_subproc->acquire (wait))
|
||||||
{
|
{
|
||||||
sync_proc_subproc->acquire ();
|
|
||||||
for (waitq *w = &waitq_head; w->next != NULL; w = w->next)
|
for (waitq *w = &waitq_head; w->next != NULL; w = w->next)
|
||||||
if (w->next == &wq)
|
if (w->next == &wq)
|
||||||
{
|
{
|
||||||
|
@ -483,6 +484,7 @@ _cygtls::remove_wq ()
|
||||||
}
|
}
|
||||||
sync_proc_subproc->release ();
|
sync_proc_subproc->release ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Terminate the wait_subproc thread.
|
/* Terminate the wait_subproc thread.
|
||||||
* Called on process exit.
|
* Called on process exit.
|
||||||
|
@ -536,7 +538,6 @@ proc_terminate (void)
|
||||||
pchildren[i].release ();
|
pchildren[i].release ();
|
||||||
}
|
}
|
||||||
nchildren = nzombies = 0;
|
nchildren = nzombies = 0;
|
||||||
sync_proc_subproc = NULL;
|
|
||||||
}
|
}
|
||||||
sigproc_printf ("leaving");
|
sigproc_printf ("leaving");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue