From 22c69629591fc96f1e20a5b6d420949ac430fd8a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 6 May 2008 03:30:25 +0000 Subject: [PATCH] Added atomic_pointer_get(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25324 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/util/atomic.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/headers/private/kernel/util/atomic.h b/headers/private/kernel/util/atomic.h index 18f82f7b4a..510df65bec 100644 --- a/headers/private/kernel/util/atomic.h +++ b/headers/private/kernel/util/atomic.h @@ -37,6 +37,17 @@ atomic_pointer_set(PointerType** _pointer, const PointerType* set) #endif } + +template PointerType* +atomic_pointer_get(PointerType** _pointer) +{ +#if LONG_MAX == INT_MAX + return (PointerType*)atomic_get((vint32*)_pointer); +#else + return (PointerType*)atomic_get64((vint64*)_pointer); +#endif +} + #endif // __cplusplus #endif /* _KERNEL_UTIL_ATOMIC_H */