mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Upadte.
2000-04-11 Ulrich Drepper <drepper@redhat.com> * internals.h: Define MEMORY_BARRIER as empty if not defined already. * spinlock.c (__pthread_lock): Add memory barriers. (__pthread_unlock): Likewise. * sysdeps/alpha/pt-machine.h (MEMORY_BARRIER): Define using mb instruction. (RELEASE): Not needed anymore. (__compare_and_swap): Mark asm as modifying memory. * sysdeps/powerpc/pt-machine.h (sync): Remove. Replace with definition of MEMORY_BARRIER. (__compare_and_swap): Use MEMORY_BARRIER instead of sync. * sysdeps/sparc/sparc32/pt-machine.h (RELEASE): Not needed anymore. (MEMORY_BARRIER): Define using stbar. * sysdeps/sparc/sparc64/pt-machine.h (MEMORY_BARRIER): Define using stbar. (__compare_and_swap): Use MEMORY_BARRIER to ensure ordering. Patch by Xavier Leroy <Xavier.Leroy@inria.fr> based on comments by Mike Burrows <m3b@pa.dec.com>.
This commit is contained in:
@@ -357,6 +357,13 @@ static inline pthread_descr thread_self (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the architecture
|
||||
doesn't need a memory barrier instruction (e.g. Intel x86) */
|
||||
|
||||
#ifndef MEMORY_BARRIER
|
||||
#define MEMORY_BARRIER()
|
||||
#endif
|
||||
|
||||
/* Max number of times we must spin on a spinlock calling sched_yield().
|
||||
After MAX_SPIN_COUNT iterations, we put the calling thread to sleep. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user