Cygwin: FIFO: update select

Add static functions peek_fifo, thread_fifo, start_thread_fifo, and
fifo_cleanup to select.cc.  These are based on the corresponding pipe
functions, the main difference being that peek_fifo loops through the
connected clients to see if any of them have data available for
reading.

Add the fhandler_fifo methods select_read, select_write, and
select_except.

Add accessor methods get_nclients, get_handle, and is_connected that
are needed by peek_fifo.
This commit is contained in:
Ken Brown
2019-03-22 19:30:41 +00:00
committed by Corinna Vinschen
parent 1aa438a94c
commit ee394c311e
3 changed files with 157 additions and 15 deletions

View File

@@ -53,6 +53,11 @@ struct select_pipe_info: public select_info
select_pipe_info (): select_info () {}
};
struct select_fifo_info: public select_info
{
select_fifo_info (): select_info () {}
};
struct select_socket_info: public select_info
{
int num_w4;
@@ -89,6 +94,7 @@ public:
select_record start;
select_pipe_info *device_specific_pipe;
select_fifo_info *device_specific_fifo;
select_socket_info *device_specific_socket;
select_serial_info *device_specific_serial;
select_signalfd_info *device_specific_signalfd;
@@ -102,6 +108,7 @@ public:
select_stuff (): return_on_signal (false), always_ready (false),
windows_used (false), start (),
device_specific_pipe (NULL),
device_specific_fifo (NULL),
device_specific_socket (NULL),
device_specific_serial (NULL),
device_specific_signalfd (NULL) {}