posix-threads.cc (_Jv_ThreadSelf_out_of_line): Use write_barrier, not release_set.

* 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.

From-SVN: r51101
This commit is contained in:
Bryce McKinlay 2002-03-21 00:26:46 +00:00
parent e5c4bd1bba
commit 1de21d0eac
4 changed files with 26 additions and 2 deletions

View File

@ -1,6 +1,13 @@
2002-03-20 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* 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.
2002-03-19 Martin Kahlert <martin.kahlert@infineon.com>
* include/jni.h Use correct C comments
* include/jni.h Use correct C comments.
2002-03-18 Tom Tromey <tromey@redhat.com>

View File

@ -448,7 +448,8 @@ _Jv_ThreadSelf_out_of_line(volatile self_cache_entry *sce, size_t high_sp_bits)
{
pthread_t self = pthread_self();
sce -> high_sp_bits = high_sp_bits;
release_set ((obj_addr_t *) &(sce -> self), self);
write_barrier();
sce -> self = self;
return self;
}

View File

@ -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

View File

@ -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