]> git.sesse.net Git - vlc/commitdiff
rwlock: use a proper source C module
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 10 Sep 2012 15:33:11 +0000 (18:33 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 10 Sep 2012 15:33:11 +0000 (18:33 +0300)
Initially, I made it a header file suitable for conditional inclusion.

However slim read/write locks in Windows Vista do not support
asynchronous procedure calls, so they cannot be leveraged in VLC.
Thus rwlock.c needs to be included forever on Windows. (The same
limitation prevent usage of condition variables also in Vista+.)

src/Makefile.am
src/misc/rwlock.c [moved from src/misc/rwlock.h with 100% similarity]
src/os2/thread.c
src/win32/thread.c

index 733dec6a4be522240488b5304b51b88496b2ce7d..8f9a2371b9be0d03d0ff8b3d7daaf6c985015efc 100644 (file)
@@ -269,7 +269,7 @@ SOURCES_libvlc_win32 = \
        win32/dirs.c \
        win32/filesystem.c \
        win32/plugin.c \
-       misc/rwlock.h \
+       misc/rwlock.c \
        win32/thread.c \
        win32/specific.c \
        win32/winsock.c \
@@ -288,7 +288,7 @@ SOURCES_libvlc_os2 = \
        os2/dirs.c \
        os2/filesystem.c \
        os2/plugin.c \
-       misc/rwlock.h \
+       misc/rwlock.c \
        os2/thread.c \
        os2/specific.c \
        os2/rand.c \
similarity index 100%
rename from src/misc/rwlock.h
rename to src/misc/rwlock.c
index 0be1e2a2297b3540861c4c1008dd5fad0871c3a8..a1cdd62f43dc8a994383db70999aa8390f42b04b 100644 (file)
@@ -428,8 +428,6 @@ void vlc_sem_wait (vlc_sem_t *sem)
     } while (rc == ERROR_INTERRUPT);
 }
 
-#include "misc/rwlock.h"
-
 /*** Thread-specific variables (TLS) ***/
 struct vlc_threadvar
 {
index 848c5a3c68c0ee31d22998748e5737594c126fae..00bed00cdf599fc47a28cff9930fdc8778028b7d 100644 (file)
@@ -302,32 +302,6 @@ void vlc_sem_wait (vlc_sem_t *sem)
     while (result == WAIT_IO_COMPLETION);
 }
 
-/*** Read/write locks */
-#if 0
-/* SRW (Slim Read Write) locks are available in Vista+ only */
-void vlc_rwlock_init (vlc_rwlock_t *lock)
-{
-}
-
-void vlc_rwlock_destroy (vlc_rwlock_t *lock)
-{
-}
-
-void vlc_rwlock_rdlock (vlc_rwlock_t *lock)
-{
-}
-
-void vlc_rwlock_wrlock (vlc_rwlock_t *lock)
-{
-}
-
-void vlc_rwlock_unlock (vlc_rwlock_t *lock)
-{
-}
-#else
-# include "misc/rwlock.h"
-#endif
-
 /*** Thread-specific variables (TLS) ***/
 struct vlc_threadvar
 {