]> git.sesse.net Git - vlc/commitdiff
Small simplification
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 6 Jul 2009 20:49:46 +0000 (23:49 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 6 Jul 2009 20:49:46 +0000 (23:49 +0300)
src/misc/w32thread.c

index 7c722c74ff0a3181fc577d477c467e18f8175c25..a696dd1d6356ab22e0d1a3c7fc4ed08522b84b3f 100644 (file)
@@ -339,6 +339,7 @@ void vlc_rwlock_wrlock (vlc_rwlock_t *lock)
     lock->writers++;
     while ((lock->readers > 0) || (lock->writer != 0))
         vlc_cond_wait (&lock->write_wait, &lock->mutex);
+    lock->writers--;
     lock->writer = GetCurrentThreadId ();
     vlc_mutex_unlock (&lock->mutex);
 }
@@ -352,11 +353,7 @@ void vlc_rwlock_unlock (vlc_rwlock_t *lock)
     if (lock->readers > 0)
         lock->readers--; /* Read unlock */
     else
-    {
         lock->writer = 0; /* Write unlock */
-        assert (lock->writers > 0);
-        lock->writers--;
-    }
 
     if (lock->writers > 0)
     {