From 27296ffe5ad3ef1d1e213b1e4e824687e82bf5f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 10 Aug 2008 21:55:10 +0300 Subject: [PATCH] barrier: avoid staticity and pthread-specificity --- include/vlc_threads.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/vlc_threads.h b/include/vlc_threads.h index df7107e68e..ad1f80bd3c 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 } -- 2.39.2