* 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:
@ -219,7 +219,7 @@ class fhandler_base
|
||||
int get_default_fmode (int flags);
|
||||
|
||||
bool get_r_no_interrupt () { return FHISSETF (NOEINTR); }
|
||||
void set_r_no_interrupt (int b) { FHCONDSETF (b, NOEINTR); }
|
||||
void set_r_no_interrupt (bool b) { FHCONDSETF (b, NOEINTR); }
|
||||
|
||||
bool get_close_on_exec () { return FHISSETF (CLOEXEC); }
|
||||
int set_close_on_exec_flag (int b) { return FHCONDSETF (b, CLOEXEC); }
|
||||
@ -473,6 +473,7 @@ class fhandler_pipe: public fhandler_base
|
||||
void set_eof () {broken_pipe = true;}
|
||||
friend int make_pipe (int fildes[2], unsigned int psize, int mode);
|
||||
HANDLE get_guard () const {return guard;}
|
||||
int ready_for_read (int fd, DWORD howlong);
|
||||
};
|
||||
|
||||
class fhandler_dev_raw: public fhandler_base
|
||||
|
Reference in New Issue
Block a user