diff --git a/include/ucore/atomic.h b/include/ucore/atomic.h index 84e34d5..bb9194d 100644 --- a/include/ucore/atomic.h +++ b/include/ucore/atomic.h @@ -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.