Cygwin: fhandler_fifo::take_ownership: don't set event unnecessarily
Don't set update_needed_evt if there's currently no owner. This will cause unnecessary churn once I'm the owner and am listening for connections.
This commit is contained in:
parent
4f25d82cb1
commit
a4dc0eb15c
@ -1186,8 +1186,11 @@ fhandler_fifo::take_ownership ()
|
||||
return;
|
||||
}
|
||||
set_pending_owner (me);
|
||||
/* Wake up my fifo_reader_thread. */
|
||||
owner_needed ();
|
||||
SetEvent (update_needed_evt);
|
||||
if (get_owner ())
|
||||
/* Wake up owner's fifo_reader_thread. */
|
||||
SetEvent (update_needed_evt);
|
||||
owner_unlock ();
|
||||
/* The reader threads should now do the transfer. */
|
||||
WaitForSingleObject (owner_found_evt, INFINITE);
|
||||
|
Loading…
Reference in New Issue
Block a user