[vlc-devel] commit: barrier: avoid staticity and pthread-specificity ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Aug 10 20:52:45 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Aug 10 21:55:10 2008 +0300| [27296ffe5ad3ef1d1e213b1e4e824687e82bf5f8] | committer: Rémi Denis-Courmont 

barrier: avoid staticity and pthread-specificity

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

 include/vlc_threads.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index df7107e..ad1f80b 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -565,12 +565,12 @@ static inline void barrier (void)
     asm volatile ("sync":::"memory");
 #elif defined(__i386__)
     asm volatile ("mfence":::"memory");
-#elif defined (LIBVLC_USE_PTHREAD)
-    static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
-    pthread_mutex_lock (&lock);
-    pthread_mutex_unlock (&lock);
 #else
-# error barrier not implemented!
+    vlc_spin_t spin;
+    vlc_spin_init (&spin);
+    vlc_spin_lock (&spin);
+    vlc_spin_unlock (&spin);
+    vlc_spin_destroy (&spin);
 #endif
 }
 




More information about the vlc-devel mailing list