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:
parent
633278b877
commit
094a2a17ad
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
What's new:
|
||||
-----------
|
||||
|
||||
|
||||
What changed:
|
||||
-------------
|
||||
|
||||
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- Fix a resource leak in posix timers.
|
||||
Addresses: https://cygwin.com/ml/cygwin/2019-03/msg00120.html
|
Loading…
Reference in New Issue