Skip to content

Commit a3e41b5

Browse files
the8472cuviper
andcommitted
Apply suggestions from code review
Co-authored-by: Josh Stone <cuviper@gmail.com>
1 parent db5dfd2 commit a3e41b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/sync/mutex.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ use crate::sys::locks as sys;
107107
/// *guard += 1;
108108
/// ```
109109
///
110-
/// It is sometimes necessary to manually drop the mutex guard or to create an inner scope
111-
/// to unlock it sooner than the end of the enclosing scope.
110+
/// To unlock a mutex guard sooner than the end of the enclosing scope,
111+
/// either create an inner scope or drop the guard manually.
112112
///
113113
/// ```
114114
/// use std::sync::{Arc, Mutex};
@@ -153,7 +153,7 @@ use crate::sys::locks as sys;
153153
/// // It's even more important here than in the threads because we `.join` the
154154
/// // threads after that. If we had not dropped the mutex guard, a thread could
155155
/// // be waiting forever for it, causing a deadlock.
156-
/// // As in the threads a block could have been used instead of calling the
156+
/// // As in the threads, a block could have been used instead of calling the
157157
/// // `drop` function.
158158
/// drop(data);
159159
/// // Here the mutex guard is not assigned to a variable and so, even if the

0 commit comments

Comments
 (0)