summaryrefslogtreecommitdiff
path: root/include/linux/rwsem.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rwsem.h')
-rw-r--r--include/linux/rwsem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index e7829531c4ba..6a1a7bae5f81 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -57,7 +57,7 @@ context_lock_struct(rw_semaphore) {
struct optimistic_spin_queue osq; /* spinner MCS lock */
#endif
raw_spinlock_t wait_lock;
- struct rwsem_waiter *first_waiter;
+ struct rwsem_waiter *first_waiter __guarded_by(&wait_lock);
#ifdef CONFIG_DEBUG_RWSEMS
void *magic;
#endif
@@ -131,7 +131,7 @@ do { \
*/
static inline bool rwsem_is_contended(struct rw_semaphore *sem)
{
- return sem->first_waiter != NULL;
+ return data_race(sem->first_waiter != NULL);
}
#if defined(CONFIG_DEBUG_RWSEMS) || defined(CONFIG_DETECT_HUNG_TASK_BLOCKER)