You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistency in the document of std::sync::Mutex #40176
In the document of std::sync::Mutex, lock and mutex are used interchangeably.
For example, the document of lock() is as follows:
/// This function will block the local thread until it is available to acquire/// the mutex. Upon returning, the thread is the only thread with the mutex/// held. An RAII guard is returned to allow scoped unlock of the lock. When/// the guard goes out of scope, the mutex will be unlocked.
Here, the lock and the mutex are used to refer to the same Mutex object. As a non-native English speaker, this kind of inconsistency is somewhat confusing. This is especially the case for this document because lock also refers to the operation on the mutex object.
I do understand these two words are interchangable unless you are writing a thesis or the like. However, I feel that using them consistently throughout the document makes it more readable.
Therefore, I would like to suggest to use mutex to refer to the Mutex object, and lock or unlock to refer to the operations on the Mutex object.
e.g. An RAII guard is returned to allow scoped unlock of the mutex.
Sorry in advance if this inconsistency is intentional.
Activity
steveklabnik commentedon Mar 15, 2017
docs team triage: @GuillaumeGomez is gonna take this one
Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…