summaryrefslogtreecommitdiff
path: root/kern/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/atomic.h')
-rw-r--r--kern/atomic.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/kern/atomic.h b/kern/atomic.h
index 6c0105d..940720a 100644
--- a/kern/atomic.h
+++ b/kern/atomic.h
@@ -16,6 +16,9 @@
*
*
* Type-generic memory-model aware atomic operations.
+ *
+ * TODO Replace mentions of "memory barriers" throughout the code with
+ * C11 memory model terminology.
*/
#ifndef _KERN_ATOMIC_H
@@ -113,6 +116,15 @@ MACRO_END
#endif
/*
+ * Thread fences.
+ */
+
+#define atomic_fence_acquire() __atomic_thread_fence(ATOMIC_ACQUIRE)
+#define atomic_fence_release() __atomic_thread_fence(ATOMIC_RELEASE)
+#define atomic_fence_acq_rel() __atomic_thread_fence(ATOMIC_ACQ_REL)
+#define atomic_fence_seq_cst() __atomic_thread_fence(ATOMIC_SEQ_CST)
+
+/*
* Common shortcuts.
*/