[vlc-commits] rwlock: use a proper source C module

Rémi Denis-Courmont git at videolan.org
Mon Sep 10 17:36:49 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep 10 18:33:11 2012 +0300| [116c1df8d328fe1eba0006bdeec0a7c391b27f34] | committer: Rémi Denis-Courmont

rwlock: use a proper source C module

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+.)

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

 src/Makefile.am                 |    4 ++--
 src/misc/{rwlock.h => rwlock.c} |    0
 src/os2/thread.c                |    2 --
 src/win32/thread.c              |   26 --------------------------
 4 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 733dec6..8f9a237 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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 \
diff --git a/src/misc/rwlock.h b/src/misc/rwlock.c
similarity index 100%
rename from src/misc/rwlock.h
rename to src/misc/rwlock.c
diff --git a/src/os2/thread.c b/src/os2/thread.c
index 0be1e2a..a1cdd62 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -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
 {
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 848c5a3..00bed00 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -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
 {



More information about the vlc-commits mailing list