* cygthread.cc (cygthread::stub): Accept flag to pass info structure to thread

function.
(cygthread::operator new): Add defense debugging output.
(cygthread::cygthread): Add debugging output.  Set name after thread has been
awakened to avoid a race.
(cygthread::exit_thread): Use handle operator rather than using ev directly.
(cygthread::exit_thread): Reorganize to provide debugging.  Set __name to NULL.
* cygthread.h (cygself): Define.
* fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument so that
invoked thread can access its own info.
(process_output): Derive cygthread info of thread from thread argument.
* sigproc.cc (sigproc_init): Use cygself as argument so that invoked thread can
access its own info.
(wait_sig): Derive cygthread info of thread from thread argument.
This commit is contained in:
Christopher Faylor
2002-08-06 05:08:55 +00:00
parent ffebb4fe0c
commit 1524ae42cf
5 changed files with 53 additions and 14 deletions

View File

@@ -69,7 +69,7 @@ fhandler_tty_master::init (int ntty)
h = new cygthread (process_ioctl, NULL, "ttyioctl");
SetThreadPriority (*h, THREAD_PRIORITY_HIGHEST);
output_thread = new cygthread (process_output, NULL, "ttyout");
output_thread = new cygthread (process_output, cygself, "ttyout");
SetThreadPriority (*output_thread, THREAD_PRIORITY_HIGHEST);
return 0;
@@ -369,7 +369,7 @@ out:
}
static DWORD WINAPI
process_output (void *)
process_output (void *self)
{
char buf[OUT_BUFFER_SIZE*2];
@@ -380,7 +380,7 @@ process_output (void *)
{
if (n < 0)
termios_printf ("ReadFile %E");
cygthread *t = tty_master->output_thread;
cygthread *t = (cygthread *) self;
tty_master->output_thread = NULL;
t->exit_thread ();
}