X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Funlocked.h;h=8a1e98bb2ee7068e6246e130b186c16abcca09d3;hb=52418d713f478a9f23cdb1a76575d58bea225009;hp=a989dafdbc7f0b7fdb143bbf4974658ba5608ffd;hpb=e2a86a54f1052c9bd4d0d4e5e125aafe56d1f067;p=mono.git diff --git a/mono/utils/unlocked.h b/mono/utils/unlocked.h index a989dafdbc7..8a1e98bb2ee 100644 --- a/mono/utils/unlocked.h +++ b/mono/utils/unlocked.h @@ -20,6 +20,8 @@ #if MONO_HAS_CLANG_THREAD_SANITIZER #define MONO_UNLOCKED_ATTRS MONO_NO_SANITIZE_THREAD MONO_NEVER_INLINE static +#elif defined(_MSC_VER) +#define MONO_UNLOCKED_ATTRS MONO_ALWAYS_INLINE static #else #define MONO_UNLOCKED_ATTRS MONO_ALWAYS_INLINE static inline #endif @@ -31,6 +33,20 @@ UnlockedIncrement (gint32 *val) return ++*val; } +MONO_UNLOCKED_ATTRS +gint64 +UnlockedIncrement64 (gint64 *val) +{ + return ++*val; +} + +MONO_UNLOCKED_ATTRS +gint64 +UnlockedDecrement64 (gint64 *val) +{ + return --*val; +} + MONO_UNLOCKED_ATTRS gint32 UnlockedDecrement (gint32 *val) @@ -52,6 +68,13 @@ UnlockedAdd64 (gint64 *dest, gint64 add) return *dest += add; } +MONO_UNLOCKED_ATTRS +gdouble +UnlockedAddDouble (gdouble *dest, gdouble add) +{ + return *dest += add; +} + MONO_UNLOCKED_ATTRS gint64 UnlockedSubtract64 (gint64 *dest, gint64 sub) @@ -66,6 +89,20 @@ UnlockedWrite (gint32 *dest, gint32 val) *dest = val; } +MONO_UNLOCKED_ATTRS +void +UnlockedWrite64 (gint64 *dest, gint64 val) +{ + *dest = val; +} + +MONO_UNLOCKED_ATTRS +void +UnlockedWriteBool (gboolean *dest, gboolean val) +{ + *dest = val; +} + MONO_UNLOCKED_ATTRS gint32 UnlockedRead (gint32 *src) @@ -80,4 +117,18 @@ UnlockedRead64 (gint64 *src) return *src; } +MONO_UNLOCKED_ATTRS +gboolean +UnlockedReadBool (gboolean *src) +{ + return *src; +} + +MONO_UNLOCKED_ATTRS +gpointer +UnlockedReadPointer (volatile gpointer *src) +{ + return *src; +} + #endif /* _UNLOCKED_H_ */