From b6bd703781fdbe466e5a4d41e16743a642e7c0d3 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 1 Aug 2002 16:20:31 +0000 Subject: * 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. --- winsup/cygwin/fhandler_tty.cc | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) (limited to 'winsup/cygwin/fhandler_tty.cc') diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 013e8dcc2..2ead75122 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -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 -- cgit v1.2.3