Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in the document of std::sync::Mutex #40176

Closed
topecongiro opened this Issue Mar 1, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@topecongiro
Copy link
Contributor

topecongiro commented Mar 1, 2017

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.

@steveklabnik steveklabnik added the A-docs label Mar 1, 2017

@steveklabnik steveklabnik added T-doc and removed T-doc labels Mar 10, 2017

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Mar 15, 2017

docs team triage: @GuillaumeGomez is gonna take this one

@steveklabnik steveklabnik added the P-high label Mar 15, 2017

@steveklabnik steveklabnik removed the A-docs label Mar 24, 2017

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 3, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 3, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 4, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 4, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 4, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 5, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 5, 2017

Rollup merge of rust-lang#40608 - GuillaumeGomez:mutex-doc-inconsiste…
…ncy, r=steveklabnik

Fix mutex's docs inconsistency

Fixes rust-lang#40176.

r? @steveklabnik
cc @rust-lang/docs

@bors bors closed this in #40608 Apr 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.