adjust code documentation
This commit is contained in:
parent
934eb8b391
commit
2e652e59f6
2 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
||||||
//! * On some platforms (e.g. macOS), the lock is very slow.
|
//! * On some platforms (e.g. macOS), the lock is very slow.
|
||||||
//!
|
//!
|
||||||
//! Therefore, we implement our own `RwLock`! Naively, one might reach for a
|
//! Therefore, we implement our own `RwLock`! Naively, one might reach for a
|
||||||
//! spinlock, but those [are quite problematic] when the lock is contended.
|
//! spinlock, but those [can be quite problematic] when the lock is contended.
|
||||||
//! Instead, this readers-writer lock copies its implementation strategy from
|
//! Instead, this readers-writer lock copies its implementation strategy from
|
||||||
//! the Windows [SRWLOCK] and the [usync] library. Spinning is still used for the
|
//! the Windows [SRWLOCK] and the [usync] library. Spinning is still used for the
|
||||||
//! fast path, but it is bounded: after spinning fails, threads will locklessly
|
//! fast path, but it is bounded: after spinning fails, threads will locklessly
|
||||||
|
@ -429,7 +429,7 @@ impl RwLock {
|
||||||
// The next waiter is a writer. Remove it from the queue and wake it.
|
// The next waiter is a writer. Remove it from the queue and wake it.
|
||||||
let prev = match unsafe { tail.as_ref().prev.get() } {
|
let prev = match unsafe { tail.as_ref().prev.get() } {
|
||||||
// If the lock was read-locked, multiple threads have invoked
|
// If the lock was read-locked, multiple threads have invoked
|
||||||
// `find_tail` above. Therefore, it is possible that one of
|
// `find_tail` above. Therefore, it is possible that one of
|
||||||
// them observed a newer state than this thread did, meaning
|
// them observed a newer state than this thread did, meaning
|
||||||
// there is a set `tail` field in a node before `state`. To
|
// there is a set `tail` field in a node before `state`. To
|
||||||
// make sure that the queue is valid after the link update
|
// make sure that the queue is valid after the link update
|
||||||
|
|
|
@ -1290,8 +1290,8 @@ impl Thread {
|
||||||
Thread { inner }
|
Thread { inner }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Like the public [`park`], but callable on any handle. Used to allow
|
/// Like the public [`park`], but callable on any handle. This is used to
|
||||||
/// parking in TLS destructors.
|
/// allow parking in TLS destructors.
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
/// May only be called from the thread to which this handle belongs.
|
/// May only be called from the thread to which this handle belongs.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue