commit f0e2833881e0e02bf6c26d6a283748adac04173d parent 6f4f0b37a0a7196cdaa3b09996876b9fd1b29e48 Author: Michael Savage <mikejsavage@gmail.com> Date: Sun Jan 17 23:12:09 +0000 Merge platform_barrier.h into platform_atomic.h Diffstat:
audio.cc | | | 1 | - |
platform_atomic.h | | | 2 | +- |
platform_barrier.h | | | 7 | ------- |
unix_atomic.cc | | | 3 | +++ |
work_queue.cc | | | 3 | +-- |
diff --git a/audio.cc b/audio.cc @@ -2,7 +2,6 @@ #include "audio.h" #include "assets.h" #include "memory_arena.h" -#include "platform_barrier.h" #include "platform_atomic.h" // TODO: check all soundstates are stopped after a certain one in the mixer loop? diff --git a/platform_atomic.h b/platform_atomic.h @@ -1,7 +1,7 @@ #ifndef _PLATFORM_ATOMIC_H_ #define _PLATFORM_ATOMIC_H_ -#if defined(__linux__) || defined(__APPLE__) +#if defined( __linux__ ) || defined( __APPLE__ ) #include "unix_atomic.cc" #endif diff --git a/platform_barrier.h b/platform_barrier.h @@ -1,7 +0,0 @@ -#ifndef _PLATFORM_BARRIER_H_ -#define _PLATFORM_BARRIER_H_ - -#define read_barrier() asm volatile ( "" ::: "memory" ) -#define write_barrier() asm volatile ( "" ::: "memory" ) - -#endif // _PLATFORM_BARRIER_H_ diff --git a/unix_atomic.cc b/unix_atomic.cc @@ -1,5 +1,8 @@ #include "intrinsics.h" +#define read_barrier() asm volatile ( "" ::: "memory" ) +#define write_barrier() asm volatile ( "" ::: "memory" ) + inline u8 atomic_add_u8( volatile u8 * dest, u8 i ) { return __sync_add_and_fetch( dest, i ); } diff --git a/work_queue.cc b/work_queue.cc @@ -1,9 +1,8 @@ #include "intrinsics.h" #include "work_queue.h" -#include "platform_barrier.h" -#include "platform_thread.h" #include "platform_atomic.h" #include "platform_semaphore.h" +#include "platform_thread.h" struct ThreadInfo { u32 thread_id;