[vlc-devel] commit: Remove timer serialization (we don't do it on POSIX anyway) ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Jul 23 18:09:58 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 23 19:11:09 2009 +0300| [1d91a5eead0146deefd85c4dce3f4c915a586a3a] | committer: Rémi Denis-Courmont 

Remove timer serialization (we don't do it on POSIX anyway)

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

 src/misc/w32thread.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/misc/w32thread.c b/src/misc/w32thread.c
index 1398159..96c0a88 100644
--- a/src/misc/w32thread.c
+++ b/src/misc/w32thread.c
@@ -592,23 +592,14 @@ static void CALLBACK vlc_timer_do (void *val, BOOLEAN timeout)
     vlc_timer_t *id = val;
 
     assert (timeout);
-    if (TryEnterCriticalSection (&id->serializer))
-    {
-        id->overrun = InterlockedExchange (&id->counter, 0);
-        id->func (id->data);
-        LeaveCriticalSection (&id->serializer);
-    }
-    else /* Overrun */
-        InterlockedIncrement (&id->counter);
+    id->func (id->data);
 }
 
 int vlc_timer_create (vlc_timer_t *id, void (*func) (void *), void *data)
 {
     id->func = func;
     id->data = data;
-    id->overrun = 0;
     id->handle = INVALID_HANDLE_VALUE;
-    InitializeCriticalSection (&id->serializer);
     return 0;
 }
 
@@ -616,7 +607,6 @@ void vlc_timer_destroy (vlc_timer_t *id)
 {
     if (id->handle != INVALID_HANDLE_VALUE)
         DeleteTimerQueueTimer (NULL, id->handle, NULL);
-    DeleteCriticalSection (&id->serializer);
 }
 
 void vlc_timer_schedule (vlc_timer_t *id, bool absolute,
@@ -641,5 +631,6 @@ void vlc_timer_schedule (vlc_timer_t *id, bool absolute,
 
 unsigned vlc_timer_getoverrun (const vlc_timer_t *id)
 {
-    return id->overrun;
+    (void)id;
+    return 0;
 }




More information about the vlc-devel mailing list