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

cosmetic fix

parent c39920a9
...@@ -819,27 +819,27 @@ static void *vlc_timer_thread (void *data) ...@@ -819,27 +819,27 @@ static void *vlc_timer_thread (void *data)
for (;;) for (;;)
{ {
mwait (value); mwait (value);
int canc = vlc_savecancel (); int canc = vlc_savecancel ();
timer->func (timer->data); timer->func (timer->data);
vlc_restorecancel (canc); vlc_restorecancel (canc);
if (interval == 0) if (interval == 0)
return NULL; return NULL;
mtime_t now = mdate (); mtime_t now = mdate ();
unsigned misses = (now - value) / interval; unsigned misses = (now - value) / interval;
/* Try to compensate for one miss (mwait() will return immediately) /* Try to compensate for one miss (mwait() will return immediately)
* but no more. Otherwise, we might busy loop, after extended periods * but no more. Otherwise, we might busy loop, after extended periods
* without scheduling (suspend, SIGSTOP, RT preemption, ...). */ * without scheduling (suspend, SIGSTOP, RT preemption, ...). */
if (misses > 1) if (misses > 1)
{ {
misses--; misses--;
vlc_atomic_add (&timer->overruns, misses); vlc_atomic_add (&timer->overruns, misses);
value += misses * interval; value += misses * interval;
} }
value += interval; value += 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