]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: FIFO: allow any reader to take ownership
authorKen Brown <kbrown@cornell.edu>
Sat, 25 Apr 2020 13:54:18 +0000 (09:54 -0400)
committerKen Brown <kbrown@cornell.edu>
Fri, 8 May 2020 10:45:24 +0000 (06:45 -0400)
commitbf66a56ccaee92f44ec52551969ed52542c4ecfe
tree6d5e1de24d9bbe900f7b222d9ad136d3be88bee6
parentf35dfff3dec716869132cc89827878dc22059665
Cygwin: FIFO: allow any reader to take ownership

Add a take_ownership method, used by raw_read and select.cc:peek_fifo.
It wakes up all fifo_reader_threads and allows the caller to become
owner.  The work is done by the fifo_reader_threads.

For synchronization we introduce several new fhandler_fifo data
members and methods:

- update_needed_evt signals the current owner to stop listening for
  writer connections and update its fc_handler list.

- shared_fc_handler() gets and sets the status of the fc_handler
  update process.

- get_pending_owner() and set_pending_owner() get and set the reader
  that is requesting ownership.

Finally, a new 'reading_lock' prevents two readers from trying to take
ownership simultaneously.
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_fifo.cc
winsup/cygwin/select.cc
This page took 0.031451 seconds and 5 git commands to generate.