I came across a code that seems invalid, but apparently this is because it has been sitting in the Mono Code Base for 2 years now . Below is a small excerpt. As a result of the macro, "mono_atomic_load_acquire" is assigned to the variable "count" in unload_data_unref (..) I assume that __tmp is what is assigned, but I can not find any information about using this method in C. Can anyone explain or give a useful link?
#define mono_atomic_load_acquire(target) ({ \ typeof (*target) __tmp = *target; \ LOAD_ACQUIRE_FENCE; \ __tmp; }) #define LOAD_ACQUIRE_FENCE MEMORY_BARRIER #define MEMORY_BARRIER mono_memory_barrier () static inline void mono_memory_barrier (void) {
source share