vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Wed Nov 24 
19:38:38 2010 +0200| [a3dd09aaac04ea29b564e93137a1daeea233b9cb] | committer: 
Rémi Denis-Courmont 

Allow rescheduling a one shot timer from itself

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3dd09aaac04ea29b564e93137a1daeea233b9cb
---

 src/misc/pthread.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/misc/pthread.c b/src/misc/pthread.c
index f44157b..2da18b5 100644
--- a/src/misc/pthread.c
+++ b/src/misc/pthread.c
@@ -823,6 +823,8 @@ static void *vlc_timer_thread (void *data)
         if (vlc_cond_timedwait (&timer->reschedule, &timer->lock,
                                 timer->value) == 0)
             continue;
+        if (timer->interval == 0)
+            timer->value = 0; /* disarm */
         vlc_mutex_unlock (&timer->lock);
 
         int canc = vlc_savecancel ();
@@ -834,10 +836,7 @@ static void *vlc_timer_thread (void *data)
 
         vlc_mutex_lock (&timer->lock);
         if (timer->interval == 0)
-        {
-            timer->value = 0; /* disarm */
             continue;
-        }
 
         misses = (now - timer->value) / timer->interval;
         timer->value += timer->interval;

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to