diff options
Diffstat (limited to 'winsup/cygwin/select.h')
-rw-r--r-- | winsup/cygwin/select.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/winsup/cygwin/select.h b/winsup/cygwin/select.h index 886810a..083c3c4 100644 --- a/winsup/cygwin/select.h +++ b/winsup/cygwin/select.h @@ -9,6 +9,14 @@ details. */ #ifndef _SELECT_H_ #define _SELECT_H_ +struct fh_select_data_serial +{ + DWORD event; + OVERLAPPED ov; + + fh_select_data_serial () : event (0) { memset (&ov, 0, sizeof ov); } +}; + struct select_record { int fd; @@ -25,6 +33,13 @@ struct select_record int (*verify) (select_record *, fd_set *, fd_set *, fd_set *); void (*cleanup) (select_record *, class select_stuff *); struct select_record *next; + /* If an fhandler type needs per-fhandler, per-select data, this union + is the place to add it. First candidate: fhandler_serial. */ + union + { + fh_select_data_serial *fh_data_serial; + void *fh_data_union; /* type-agnostic placeholder for constructor */ + }; void set_select_errno () {__seterrno (); thread_errno = errno;} int saw_error () {return thread_errno;} select_record (int): next (NULL) {} @@ -34,7 +49,7 @@ struct select_record except_ready (false), read_selected (false), write_selected (false), except_selected (false), except_on_write (false), startup (NULL), peek (NULL), verify (NULL), cleanup (NULL), - next (NULL) {} + next (NULL), fh_data_union (NULL) {} #ifdef DEBUGGING void dump_select_record (); #endif @@ -83,6 +98,10 @@ public: bool always_ready, windows_used; select_record start; + /* If an fhandler type needs a singleton per-select datastructure for all + its objects in the descriptor lists, here's the place to be. This is + mainly used to maintain a single thread for all fhandlers of a single + type in the descriptor lists. */ select_pipe_info *device_specific_pipe; select_pipe_info *device_specific_ptys; select_fifo_info *device_specific_fifo; |