Skip to content

Commit 87b9e3f

Browse files
committed
use C++11 atomics
1 parent 7d8b725 commit 87b9e3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tbb/include/tbb/machine/macos_common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ static inline int64_t __TBB_machine_cmpswp8_OsX(volatile void *ptr, int64_t valu
9191
fence usages where a more lightweight synchronization means (or none at all)
9292
could suffice. Thus if you use this header to enable TBB on a new platform,
9393
consider forking it and relaxing below helpers as appropriate. **/
94-
#define __TBB_control_consistency_helper() OSMemoryBarrier()
95-
#define __TBB_acquire_consistency_helper() OSMemoryBarrier()
96-
#define __TBB_release_consistency_helper() OSMemoryBarrier()
97-
#define __TBB_full_memory_fence() OSMemoryBarrier()
94+
#define __TBB_control_consistency_helper() std::atomic_thread_fence(std::memory_order_seq_cst)
95+
#define __TBB_acquire_consistency_helper() std::atomic_thread_fence(std::memory_order_seq_cst)
96+
#define __TBB_release_consistency_helper() std::atomic_thread_fence(std::memory_order_seq_cst)
97+
#define __TBB_full_memory_fence() std::atomic_thread_fence(std::memory_order_seq_cst)
9898

9999
static inline int32_t __TBB_machine_cmpswp4(volatile void *ptr, int32_t value, int32_t comparand)
100100
{

0 commit comments

Comments
 (0)