* Makefile.in (DLL_OFILES): Add cygthread.o.

* dcrt0.cc (dll_crt0_1): Eliminate various thread initialization functions in
favor of new cygthread class.
* debug.cc: Remove thread manipulation functions.
* debug.h: Ditto.
* external.cc (cygwin_internal): Use cygthread method for determining thread
name.  Remove capability for setting thread name.
* fhandler_console.cc (fhandler_console::read): Use cygthread method rather
than iscygthread function.
* fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use cygthread
methods to create threads.
(fhandler_tty_common::__acquire_output_mutex): Use cygthread method to retrieve
thread name.
* select.cc (pipeinf): Use cygthread pointer rather than handle.
(start_thread_pipe): Ditto.
(pipe_cleanup): Ditto.
(serialinf): Ditto.
(start_thread_serial): Ditto.
(serial_cleanup): Ditto.
(socketinf): Ditto.
(start_thread_socket): Ditto.
(socket_cleanup): Ditto.
* sigproc.cc (hwait_sig): Ditto.
(hwait_subproc): Ditto.
(proc_terminate): Ditto.
(sigproc_terminate): Ditto.
(sigproc_init): Initialize cygthread hwait_sig pointer.
(subproc_init): Initialize cygthread hwait_subproc pointer.
(wait_sig): Rely on cygthread HANDLE operator.
* strace.cc (strace::vsprntf): Use cygthread::name rather than threadname.
* window.cc (gethwnd): Use cygthread method to initialize thread.
This commit is contained in:
Christopher Faylor
2002-08-01 16:20:31 +00:00
parent 3874ac637c
commit b6bd703781
15 changed files with 321 additions and 287 deletions

View File

@@ -26,6 +26,7 @@ details. */
#include "shared_info.h"
#include "cygwin/cygserver_transport.h"
#include "cygwin/cygserver.h"
#include "cygthread.h"
/* Tty master stuff */
@@ -43,7 +44,6 @@ fhandler_tty_master::fhandler_tty_master (int unit)
int
fhandler_tty_master::init (int ntty)
{
HANDLE h;
termios_printf ("Creating master for tty%d", ntty);
if (init_console ())
@@ -62,38 +62,16 @@ fhandler_tty_master::init (int ntty)
inuse = get_ttyp ()->create_inuse (TTY_MASTER_ALIVE);
h = makethread (process_input, NULL, 0, "ttyin");
if (h == NULL)
{
termios_printf ("can't create input thread");
return -1;
}
else
{
SetThreadPriority (h, THREAD_PRIORITY_HIGHEST);
CloseHandle (h);
}
cygthread *h;
h = new cygthread (process_input, NULL, "ttyin");
SetThreadPriority (*h, THREAD_PRIORITY_HIGHEST);
h = makethread (process_ioctl, NULL, 0, "ttyioctl");
if (h == NULL)
{
termios_printf ("can't create ioctl thread");
return -1;
}
else
{
SetThreadPriority (h, THREAD_PRIORITY_HIGHEST);
CloseHandle (h);
}
h = new cygthread (process_ioctl, NULL, "ttyioctl");
SetThreadPriority (*h, THREAD_PRIORITY_HIGHEST);
hThread = makethread (process_output, NULL, 0, "ttyout");
if (hThread != NULL)
SetThreadPriority (hThread, THREAD_PRIORITY_HIGHEST);
else
{
termios_printf ("can't create output thread");
return -1;
}
h = new cygthread (process_output, NULL, "ttyout");
hThread = *h;
SetThreadPriority (h, THREAD_PRIORITY_HIGHEST);
return 0;
}
@@ -125,7 +103,7 @@ fhandler_tty_common::__acquire_output_mutex (const char *fn, int ln,
#else
ostack[osi].fn = fn;
ostack[osi].ln = ln;
ostack[osi].tname = threadname (0, 0);
ostack[osi].tname = cygthread::name ();
termios_printf ("acquired for %s:%d, osi %d", fn, ln, osi);
osi++;
#endif