Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: gcc/libgomp/config/linux/mutex.h

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/libgomp/config.h.in ('k') | gcc/libgomp/configure » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/libgomp/config/linux/mutex.h
diff --git a/gcc/libgomp/config/linux/mutex.h b/gcc/libgomp/config/linux/mutex.h
index 07a2156a462966818f5e4066a4573004df251ca1..1905ce012fde79b8b57ccc5a338be8f2b895eebf 100644
--- a/gcc/libgomp/config/linux/mutex.h
+++ b/gcc/libgomp/config/linux/mutex.h
@@ -48,6 +48,16 @@ static inline void gomp_mutex_lock (gomp_mutex_t *mutex)
extern void gomp_mutex_unlock_slow (gomp_mutex_t *mutex);
static inline void gomp_mutex_unlock (gomp_mutex_t *mutex)
{
+ /* Warning: By definition __sync_lock_test_and_set() does not have
+ proper memory barrier semantics for a mutex unlock operation.
+ However, this default implementation is written assuming that it
+ does, which is true for some targets.
+
+ Targets that require additional memory barriers before
+ __sync_lock_test_and_set to achieve the release semantics of
+ mutex unlock, are encouraged to include
+ "config/linux/ia64/mutex.h" in a target specific mutex.h instead
+ of using this file. */
int val = __sync_lock_test_and_set (mutex, 0);
if (__builtin_expect (val > 1, 0))
gomp_mutex_unlock_slow (mutex);
« no previous file with comments | « gcc/libgomp/config.h.in ('k') | gcc/libgomp/configure » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698