From: RĂ©mi Denis-Courmont Date: Sun, 10 Aug 2008 18:55:10 +0000 (+0300) Subject: barrier: avoid staticity and pthread-specificity X-Git-Tag: 0.9.0~475 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=27296ffe5ad3ef1d1e213b1e4e824687e82bf5f8;p=vlc barrier: avoid staticity and pthread-specificity --- 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 }