summaryrefslogtreecommitdiff
path: root/libjava/sysdep
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-21 00:26:46 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-21 00:26:46 +0000
commitd30cece008b62a32c342597ac2f1c074c1d510f1 (patch)
tree9c7009e8040fa889ee77996438bd374542bd3833 /libjava/sysdep
parent9f61d5726a1ef8a44fce91ba7764d64d3fadf5b5 (diff)
downloadgcc-d30cece008b62a32c342597ac2f1c074c1d510f1.tar.gz
* posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use write_barrier,
not release_set. * sysdep/powerpc/locks.h (write_barrier): New function. * sysdep/i386/locks.h (write_barrier): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51101 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/sysdep')
-rw-r--r--libjava/sysdep/i386/locks.h8
-rw-r--r--libjava/sysdep/powerpc/locks.h8
2 files changed, 16 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
diff --git a/libjava/sysdep/powerpc/locks.h b/libjava/sysdep/powerpc/locks.h
index 414b5dcb7f8..4d4532b1f83 100644
--- a/libjava/sysdep/powerpc/locks.h
+++ b/libjava/sysdep/powerpc/locks.h
@@ -75,4 +75,12 @@ read_barrier()
__asm__ __volatile__ ("isync" : : : "memory");
}
+// Ensure that prior stores to memory are completed with respect to other
+// processors.
+inline static void
+write_barrier()
+{
+ __asm__ __volatile__ ("sync" : : : "memory");
+}
+
#endif