3 * Contains inline functions to explicitly mark data races that should not be changed.
4 * This way, instruments like Clang's ThreadSanitizer can be told to ignore very specific instructions.
6 * Please keep this file and its methods organised:
7 * * Increment, Decrement, Add, Subtract, Write, Read
8 * * gint32 (""), guint32 ("Unsigned"),
9 * gint64 ("64"), guint64 ("Unsigned64"),
10 * gsize ("Size"), gboolean ("Bool")
12 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
19 #include <mono/utils/mono-compiler.h>
21 #if MONO_HAS_CLANG_THREAD_SANITIZER
22 #define MONO_UNLOCKED_ATTRS MONO_NO_SANITIZE_THREAD MONO_NEVER_INLINE static
24 #define MONO_UNLOCKED_ATTRS MONO_ALWAYS_INLINE static inline
29 UnlockedIncrement (gint32 *val)
36 UnlockedIncrement64 (gint64 *val)
43 UnlockedDecrement64 (gint64 *val)
50 UnlockedDecrement (gint32 *val)
57 UnlockedAdd (gint32 *dest, gint32 add)
64 UnlockedAdd64 (gint64 *dest, gint64 add)
71 UnlockedAddDouble (gdouble *dest, gdouble add)
78 UnlockedSubtract64 (gint64 *dest, gint64 sub)
85 UnlockedWrite (gint32 *dest, gint32 val)
92 UnlockedWrite64 (gint64 *dest, gint64 val)
99 UnlockedRead (gint32 *src)
106 UnlockedRead64 (gint64 *src)
111 #endif /* _UNLOCKED_H_ */