Skip to content

Commit

Permalink
replace mfence with lock'ed inst
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Netto authored and Diogo Netto committed Jan 4, 2023
1 parent b6794f9 commit d0907be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/julia_atomics.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ enum jl_memory_order {
* are). We also need to access these atomic variables from the LLVM JIT code
* which is very hard unless the layout of the object is fully specified.
*/
#define jl_fence() atomic_thread_fence(memory_order_seq_cst)
#if defined(_CPU_X86_64_)
#define jl_fence() __asm__ volatile("lock orq $0 , (%rsp)")
#else
#define jl_fence() atomic_thread_fence(memory_order_seq_cst)
#endif
#define jl_fence_release() atomic_thread_fence(memory_order_release)
#define jl_signal_fence() atomic_signal_fence(memory_order_seq_cst)

Expand Down

0 comments on commit d0907be

Please sign in to comment.