vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Wed Nov 24 18:43:16 2010 +0200| [8d622c5bb504d48e4b1ad60b55f9f9a9839d15b6] | committer: Rémi Denis-Courmont
cosmetic fix > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8d622c5bb504d48e4b1ad60b55f9f9a9839d15b6 --- src/misc/pthread.c | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/misc/pthread.c b/src/misc/pthread.c index 761493b..7603b24 100644 --- a/src/misc/pthread.c +++ b/src/misc/pthread.c @@ -819,27 +819,27 @@ static void *vlc_timer_thread (void *data) for (;;) { - mwait (value); - - int canc = vlc_savecancel (); - timer->func (timer->data); - vlc_restorecancel (canc); - - if (interval == 0) - return NULL; - - mtime_t now = mdate (); - unsigned misses = (now - value) / interval; - /* Try to compensate for one miss (mwait() will return immediately) - * but no more. Otherwise, we might busy loop, after extended periods - * without scheduling (suspend, SIGSTOP, RT preemption, ...). */ - if (misses > 1) - { - misses--; - vlc_atomic_add (&timer->overruns, misses); - value += misses * interval; - } - value += interval; + mwait (value); + + int canc = vlc_savecancel (); + timer->func (timer->data); + vlc_restorecancel (canc); + + if (interval == 0) + return NULL; + + mtime_t now = mdate (); + unsigned misses = (now - value) / interval; + /* Try to compensate for one miss (mwait() will return immediately) + * but no more. Otherwise, we might busy loop, after extended periods + * without scheduling (suspend, SIGSTOP, RT preemption, ...). */ + if (misses > 1) + { + misses--; + vlc_atomic_add (&timer->overruns, misses); + value += misses * interval; + } + value += interval; } } _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
