@@ -12,12 +12,10 @@ * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ -OF_ASSUME_NONNULL_BEGIN - static OF_INLINE int of_atomic_int_add(volatile int *_Nonnull p, int i) { return __atomic_add_fetch(p, i, __ATOMIC_RELAXED); } @@ -133,35 +131,21 @@ return __atomic_compare_exchange(p, &o, &n, false, __ATOMIC_RELAXED, __ATOMIC_RELAXED); } static OF_INLINE void -of_memory_barrier_sync(void) +of_memory_barrier_full(void) { __atomic_thread_fence(__ATOMIC_SEQ_CST); } static OF_INLINE void -of_memory_barrier_enter(void) -{ - __atomic_thread_fence(__ATOMIC_SEQ_CST); -} - -static OF_INLINE void -of_memory_barrier_exit(void) -{ - __atomic_thread_fence(__ATOMIC_SEQ_CST); -} - -static OF_INLINE void -of_memory_barrier_producer(void) -{ - __atomic_thread_fence(__ATOMIC_SEQ_CST); -} - -static OF_INLINE void -of_memory_barrier_consumer(void) -{ - __atomic_thread_fence(__ATOMIC_SEQ_CST); -} - -OF_ASSUME_NONNULL_END +of_memory_barrier_acquire(void) +{ + __atomic_thread_fence(__ATOMIC_ACQUIRE); +} + +static OF_INLINE void +of_memory_barrier_release(void) +{ + __atomic_thread_fence(__ATOMIC_RELEASE); +}