Apply suggestions from code review

Co-authored-by: Josh Stone <cuviper@gmail.com>
This commit is contained in:
the8472 2023-03-20 12:07:27 +01:00 committed by The 8472
parent db5dfd2373
commit a3e41b5759

View File

@ -107,8 +107,8 @@
/// *guard += 1;
/// ```
///
/// It is sometimes necessary to manually drop the mutex guard or to create an inner scope
/// to unlock it sooner than the end of the enclosing scope.
/// To unlock a mutex guard sooner than the end of the enclosing scope,
/// either create an inner scope or drop the guard manually.
///
/// ```
/// use std::sync::{Arc, Mutex};
@ -153,7 +153,7 @@
/// // It's even more important here than in the threads because we `.join` the
/// // threads after that. If we had not dropped the mutex guard, a thread could
/// // be waiting forever for it, causing a deadlock.
/// // As in the threads a block could have been used instead of calling the
/// // As in the threads, a block could have been used instead of calling the
/// // `drop` function.
/// drop(data);
/// // Here the mutex guard is not assigned to a variable and so, even if the