Commit a3dd09aa authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Allow rescheduling a one shot timer from itself

parent 020fbe57
...@@ -823,6 +823,8 @@ static void *vlc_timer_thread (void *data) ...@@ -823,6 +823,8 @@ static void *vlc_timer_thread (void *data)
if (vlc_cond_timedwait (&timer->reschedule, &timer->lock, if (vlc_cond_timedwait (&timer->reschedule, &timer->lock,
timer->value) == 0) timer->value) == 0)
continue; continue;
if (timer->interval == 0)
timer->value = 0; /* disarm */
vlc_mutex_unlock (&timer->lock); vlc_mutex_unlock (&timer->lock);
int canc = vlc_savecancel (); int canc = vlc_savecancel ();
...@@ -834,10 +836,7 @@ static void *vlc_timer_thread (void *data) ...@@ -834,10 +836,7 @@ static void *vlc_timer_thread (void *data)
vlc_mutex_lock (&timer->lock); vlc_mutex_lock (&timer->lock);
if (timer->interval == 0) if (timer->interval == 0)
{
timer->value = 0; /* disarm */
continue; continue;
}
misses = (now - timer->value) / timer->interval; misses = (now - timer->value) / timer->interval;
timer->value += timer->interval; timer->value += timer->interval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment