]> sourceware.org Git - newlib-cygwin.git/commit
Improve timer handling in select.
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 6 Jun 2016 14:48:38 +0000 (16:48 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 6 Jun 2016 14:48:38 +0000 (16:48 +0200)
commit7186b657e74b892581c28bfad0db9a5623f21725
treefdd2029683bf4e1a2ee1c6dc602100e64210f360
parent83834110a0279c228c5c7e232a5d7ce01dd04d3e
Improve timer handling in select.

Commit a23e6a35d896a075640db714b28ce74bb6b8d7ff introduced a timer
object to the WFMO handling in select_stuff::wait to allow sub-tickcount
timeout values in select.

Problems with this patch: The timer was created and destroyed on every
invocation of select_stuff::wait, thus potentially multiple times per
select.  Also, since the timer was prepended to the WFMO hande list,
the timer handle could shadow actual events on other objects, given that
WFMO checks the objects in the order they have been specified in the
HANDLE array.  The timer was also created/destroyed and added to the
HANDLE array even if it was not required.

This patch drops the local timer HANDLE and recycles the cw_timer HANDLE
in the cygtls area instead.  Thus we typically don't need to create the
timer in select at all, and we never have to destroy it.

The timer HANDLE is now also appended as last object to the HANDLE array,
and it's only added if actually needed.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/select.cc
This page took 0.029462 seconds and 5 git commands to generate.