linux-atomic.c (SYNC_LOCK_RELEASE): Place memory barrier before the lock release.

* arm/linux-atomic.c (SYNC_LOCK_RELEASE): Place memory barrier
	before the lock release.

From-SVN: r154949
This commit is contained in:
Richard Earnshaw 2009-12-03 14:26:46 +00:00 committed by Richard Earnshaw
parent bcaf576b83
commit cf9eb56580
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-12-03 Richard Earnshaw <rearnsha@arm.com>
* arm/linux-atomic.c (SYNC_LOCK_RELEASE): Place memory barrier
before the lock release.
2009-12-03 Michael Matz <matz@suse.de>
PR middle-end/38474

View File

@ -266,8 +266,10 @@ SUBWORD_TEST_AND_SET (char, 1)
void HIDDEN \
__sync_lock_release_##WIDTH (TYPE *ptr) \
{ \
*ptr = 0; \
/* All writes before this point must be seen before we release \
the lock itself. */ \
__kernel_dmb (); \
*ptr = 0; \
}
SYNC_LOCK_RELEASE (int, 4)