summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/mingwex/membarrier.c
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/mingwex/membarrier.c')
-rw-r--r--winsup/mingw/mingwex/membarrier.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/winsup/mingw/mingwex/membarrier.c b/winsup/mingw/mingwex/membarrier.c
new file mode 100644
index 000000000..b8da9f7de
--- /dev/null
+++ b/winsup/mingw/mingwex/membarrier.c
@@ -0,0 +1,19 @@
+/**
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+void __mingworg_MemoryBarrier(void);
+void __mingworg_MemoryBarrier(void)
+{
+ long Barrier = 0;
+ __asm__ __volatile__("xchgl %%eax,%0 "
+ :"=r" (Barrier));
+}
+