[libc-commits] [PATCH] D145608: [libc] Add intrinsic for thread fence to the atomic support

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 8 20:38:48 PST 2023


jhuber6 updated this revision to Diff 503606.
jhuber6 added a comment.

inline -> LIBC_INLINE

I think libstdc++ uses always_inline


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145608/new/

https://reviews.llvm.org/D145608

Files:
  libc/src/__support/CPP/atomic.h


Index: libc/src/__support/CPP/atomic.h
===================================================================
--- libc/src/__support/CPP/atomic.h
+++ libc/src/__support/CPP/atomic.h
@@ -92,6 +92,11 @@
   void set(T rhs) { val = rhs; }
 };
 
+// Issue a thread fence with the given memory ordering.
+LIBC_INLINE void atomic_thread_fence(MemoryOrder mem_ord) {
+  __atomic_thread_fence(int(mem_ord));
+}
+
 } // namespace cpp
 } // namespace __llvm_libc
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145608.503606.patch
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230309/d50bec55/attachment-0001.bin>


More information about the libc-commits mailing list