From 33f8d3bbae6c53c6569ef3a1095e87c692340312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Mon, 1 Sep 2014 22:19:54 +0200 Subject: [PATCH] Add ATOMIC_GET --- include/ucore/atomic.h | 5 +++++ 1 file changed, 5 insertions(+) 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.