]> git.sesse.net Git - vlc/commitdiff
Remove unused barrier()
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 10 Nov 2012 17:44:00 +0000 (19:44 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 10 Nov 2012 17:47:54 +0000 (19:47 +0200)
include/vlc_threads.h
src/misc/block.c

index e38f5ba0eec8df19303e00be1dec7736937edacc..0ae5252e1df305e95e8db5c7014c27d3d660c575 100644 (file)
@@ -148,7 +148,6 @@ typedef struct vlc_timer *vlc_timer_t;
 /* Unnamed POSIX semaphores not supported on Mac OS X */
 # include <mach/semaphore.h>
 # include <mach/task.h>
-# include <libkern/OSAtomic.h> /* OSMemoryBarrier() */
 # define LIBVLC_USE_PTHREAD           1
 # define LIBVLC_USE_PTHREAD_CLEANUP   1
 # define LIBVLC_USE_PTHREAD_CANCEL    1
@@ -486,29 +485,6 @@ static inline void vlc_spin_init (vlc_spinlock_t *spin)
 # define vlc_spin_destroy vlc_mutex_destroy
 #endif
 
-/**
- * Issues a full memory barrier.
- */
-static inline void barrier (void)
-{
-#if defined (__GNUC__) && !defined (__APPLE__) && \
-            ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
-    __sync_synchronize ();
-#elif defined(__APPLE__)
-    OSMemoryBarrier ();
-#elif defined(__powerpc__)
-    asm volatile ("sync":::"memory");
-#elif 0 // defined(__i386__) /*  Requires SSE2 support */
-    asm volatile ("mfence":::"memory");
-#else
-    vlc_spinlock_t spin;
-    vlc_spin_init (&spin);
-    vlc_spin_lock (&spin);
-    vlc_spin_unlock (&spin);
-    vlc_spin_destroy (&spin);
-#endif
-}
-
 #ifdef __cplusplus
 /**
  * Helper C++ class to lock a mutex.
index b853d351d19d7d0797e4bd5856ef881783ed19ee..069628ab230addee58ba76d6b7ae2b942bb4322e 100644 (file)
@@ -75,7 +75,6 @@ static void block_Invalidate (block_t *block)
     block->p_next = NULL;
     block_Check (block);
     block->pf_release = BlockNoRelease;
-    barrier (); /* prevent compiler from optimizing this assignment out */
 }
 #else
 # define block_Check(b) ((void)(b))