Cygwin: posix timers: fix resource leak
On setting the timer, the thread is accidentally only canceled when disarming the timer. This leaks one thread per timer_settimer call. Move the thread cancellation where it belongs. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -287,9 +287,9 @@ timer_tracker::settime (int flags, const itimerspec *new_value,
|
||||
if (old_value)
|
||||
gettime (old_value, false);
|
||||
|
||||
cancel ();
|
||||
if (!new_value->it_value.tv_sec && !new_value->it_value.tv_nsec)
|
||||
{
|
||||
cancel ();
|
||||
memset (&time_spec, 0, sizeof time_spec);
|
||||
interval = 0;
|
||||
exp_ts = 0;
|
||||
|
Reference in New Issue
Block a user