summaryrefslogtreecommitdiff
path: root/include/my_atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_atomic.h')
-rw-r--r--include/my_atomic.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/my_atomic.h b/include/my_atomic.h
index 8ba3e201730..a2f454ac319 100644
--- a/include/my_atomic.h
+++ b/include/my_atomic.h
@@ -20,6 +20,7 @@
This header defines five atomic operations:
my_atomic_add#(&var, what)
+ 'Fetch and Add'
add 'what' to *var, and return the old value of *var
my_atomic_fas#(&var, what)
@@ -27,9 +28,10 @@
store 'what' in *var, and return the old value of *var
my_atomic_cas#(&var, &old, new)
- 'Compare And Swap'
+ An odd variation of 'Compare And Set/Swap'
if *var is equal to *old, then store 'new' in *var, and return TRUE
otherwise store *var in *old, and return FALSE
+ Usually, &old should not be accessed if the operation is successful.
my_atomic_load#(&var)
return *var