diff options
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 42 |
1 files changed, 10 insertions, 32 deletions
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 |