summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-06 14:46:31 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-06 14:46:31 -0500
commit258080ea45ab633f1f3c1218f0c7a95649edeee9 (patch)
tree0c955387d5a6d2f9b4108243614167aed406c7c3 /compiler.h
parent7b3f46b13dcf8bbc1e25194fad88af5ebbb9aed2 (diff)
downloadgpsd-258080ea45ab633f1f3c1218f0c7a95649edeee9.tar.gz
Add explanatory comment.
Diffstat (limited to 'compiler.h')
-rw-r--r--compiler.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler.h b/compiler.h
index cd289786..74b8ecef 100644
--- a/compiler.h
+++ b/compiler.h
@@ -36,12 +36,13 @@
#endif /* HAVE_STDATOMIC_H */
static /*@unused@*/ inline void memory_barrier(void)
+/* prevent instruction reordering across any call to this function */
{
#ifndef S_SPLINT_S
#ifdef STD_ATOMIC_H
atomic_thread_fence(memory_order_seq_cst);
#elif defined(__GNUC__)
- asm volatile ("" : : : "memory");
+ asm volatile ("" : : : "memory");
#endif /* STD_ATOMIC_H */
#endif /* S_SPLINT_S */
}