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:
Ken Brown 2020-07-12 18:11:38 -04:00
parent 4f25d82cb1
commit a4dc0eb15c
1 changed files with 4 additions and 1 deletions

View File

@ -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);