* cygthread.h (cygthread::stack_ptr): New element.
(cygthread::detach): Accept a "wait_for_signal" argument. (cygthread::terminate_thread): New function. * cygthread.cc (cygthread::stub): Set stack pointer argument. (cygthread::terminate_thread): New function. Forcibly terminate thread. (cygthread::detach): Optionally wait for signals and kill thread when signal arrives. * exceptions.cc (signal_exit): Set signal_arrived prior to exiting to wake up anything blocking on signals. * fhandler.h (fhandler_base::set_r_no_interrupt): Change to accept bool argument. (fhandler_pipe::ready_for_read): Declare. * pipe.cc (pipeargs): New structure. (read_pipe): New thread stub wrapper for normal pipe read. (fhandler_pipe::read): Modify to call reader in a cygthread, terminating on signal, as appropriate. * select.cc (fhandler_pipe::ready_for_read): Define new function.
This commit is contained in:
@ -13,6 +13,7 @@ class cygthread
|
||||
HANDLE h;
|
||||
HANDLE ev;
|
||||
HANDLE thread_sync;
|
||||
void *stack_ptr;
|
||||
const char *__name;
|
||||
LPTHREAD_START_ROUTINE func;
|
||||
VOID *arg;
|
||||
@ -26,12 +27,13 @@ class cygthread
|
||||
cygthread (LPTHREAD_START_ROUTINE, LPVOID, const char *);
|
||||
cygthread () {};
|
||||
static void init ();
|
||||
void detach ();
|
||||
void detach (bool = false);
|
||||
operator HANDLE ();
|
||||
static bool is ();
|
||||
void * operator new (size_t);
|
||||
static cygthread *freerange ();
|
||||
void exit_thread ();
|
||||
void terminate_thread ();
|
||||
static void terminate ();
|
||||
bool SetThreadPriority (int nPriority) {return ::SetThreadPriority (h, nPriority);}
|
||||
void zap_h ()
|
||||
|
Reference in New Issue
Block a user