[vlc-commits] commit: Allow rescheduling a one shot timer from itself ( =?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Wed Nov 24 18:38:48 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | 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;



More information about the vlc-commits mailing list