Mercurial > hg > CbC > CbC_gcc
comparison libgomp/config/linux/mutex.h @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
46 } | 46 } |
47 | 47 |
48 extern void gomp_mutex_unlock_slow (gomp_mutex_t *mutex); | 48 extern void gomp_mutex_unlock_slow (gomp_mutex_t *mutex); |
49 static inline void gomp_mutex_unlock (gomp_mutex_t *mutex) | 49 static inline void gomp_mutex_unlock (gomp_mutex_t *mutex) |
50 { | 50 { |
51 /* Warning: By definition __sync_lock_test_and_set() does not have | |
52 proper memory barrier semantics for a mutex unlock operation. | |
53 However, this default implementation is written assuming that it | |
54 does, which is true for some targets. | |
55 | |
56 Targets that require additional memory barriers before | |
57 __sync_lock_test_and_set to achieve the release semantics of | |
58 mutex unlock, are encouraged to include | |
59 "config/linux/ia64/mutex.h" in a target specific mutex.h instead | |
60 of using this file. */ | |
51 int val = __sync_lock_test_and_set (mutex, 0); | 61 int val = __sync_lock_test_and_set (mutex, 0); |
52 if (__builtin_expect (val > 1, 0)) | 62 if (__builtin_expect (val > 1, 0)) |
53 gomp_mutex_unlock_slow (mutex); | 63 gomp_mutex_unlock_slow (mutex); |
54 } | 64 } |
55 | 65 |