File tree 1 file changed +7
-6
lines changed
library/std/src/sys/pal/unix/locks
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 91
91
//!
92
92
//! Access to the queue is controlled by the `QUEUE_LOCKED` bit, which threads
93
93
//! try to set both after enqueuing themselves to eagerly add backlinks to the
94
- //! queue and after unlocking the lock to wake the next waiter(s). This is done
95
- //! atomically at the same time as the enqueuing/unlocking operation. The thread
96
- //! releasing the `QUEUE_LOCK` bit will check the state of the lock and wake up
97
- //! waiters as appropriate. This guarantees forward-progress even if the unlocking
98
- //! thread could not acquire the queue lock.
94
+ //! queue, which drastically improves performance, and after unlocking the lock
95
+ //! to wake the next waiter(s). This is done atomically at the same time as the
96
+ //! enqueuing/unlocking operation. The thread releasing the `QUEUE_LOCK` bit
97
+ //! will check the state of the lock and wake up waiters as appropriate. This
98
+ //! guarantees forward-progress even if the unlocking thread could not acquire
99
+ //! the queue lock.
99
100
//!
100
101
//! ## Memory orderings
101
102
//!
@@ -358,7 +359,7 @@ impl RwLock {
358
359
} else {
359
360
// Otherwise, the tail of the queue is not known.
360
361
node. tail . set ( None ) ;
361
- // Try locking the queue to fully link it .
362
+ // Try locking the queue to eagerly add backlinks .
362
363
next = next. map_addr ( |addr| addr | QUEUE_LOCKED ) ;
363
364
}
364
365
You can’t perform that action at this time.
0 commit comments