aboutsummaryrefslogtreecommitdiff
path: root/libjava/sysdep/i386/locks.h
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/sysdep/i386/locks.h')
-rw-r--r--libjava/sysdep/i386/locks.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libjava/sysdep/i386/locks.h b/libjava/sysdep/i386/locks.h
index 0c029ac939a..a9501ae99b2 100644
--- a/libjava/sysdep/i386/locks.h
+++ b/libjava/sysdep/i386/locks.h
@@ -62,4 +62,12 @@ read_barrier()
{
}
+// Ensure that prior stores to memory are completed with respect to other
+// processors.
+inline static void
+write_barrier()
+{
+ // X86 does not reorder writes. We just need to ensure that gcc also doesn't.
+ __asm__ __volatile__(" " : : : "memory");
+}
#endif