Add ATOMIC_GET

This commit is contained in:
Nils O. Selåsdal
2014-09-01 22:19:54 +02:00
parent 7ed9bb298f
commit 33f8d3bbae
+5
View File
@@ -34,6 +34,11 @@
*/
#define UC_ATOMIC_INC(ptr) UC_ATOMIC_ADD((ptr), 1)
/**
* Atomically get the value of *ptr
* @return value of *ptr
*/
#define UC_ATOMIC_GET(ptr) UC_ATOMIC_ADD((ptr), 0)
/**
* Atomic Compare-And-Swap. If *ptr is oldval, write newwal to *ptr.