Enforce success failure pairings of compare_exchange_*_explicit at compile time

This commit is contained in:
gingerBill
2022-03-31 00:49:53 +01:00
parent ba1930eb01
commit 6bc0c611ab
3 changed files with 97 additions and 10 deletions
+11 -2
View File
@@ -693,8 +693,8 @@ gb_global Type *t_objc_SEL = nullptr;
gb_global Type *t_objc_Class = nullptr;
enum OdinAtomicMemoryOrder : i32 {
OdinAtomicMemoryOrder_relaxed = 0,
OdinAtomicMemoryOrder_consume = 1,
OdinAtomicMemoryOrder_relaxed = 0, // unordered
OdinAtomicMemoryOrder_consume = 1, // monotonic
OdinAtomicMemoryOrder_acquire = 2,
OdinAtomicMemoryOrder_release = 3,
OdinAtomicMemoryOrder_acq_rel = 4,
@@ -702,6 +702,15 @@ enum OdinAtomicMemoryOrder : i32 {
OdinAtomicMemoryOrder_COUNT,
};
char const *OdinAtomicMemoryOrder_strings[OdinAtomicMemoryOrder_COUNT] = {
"relaxed",
"consume",
"acquire",
"release",
"acq_rel",
"seq_cst",
};
gb_global Type *t_atomic_memory_order = nullptr;