We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f28e3c6 commit 0dbf5a6Copy full SHA for 0dbf5a6
examples/mutex.rs
@@ -123,6 +123,13 @@ impl<T> Mutex<T> {
123
}
124
125
126
+impl<T> Drop for MutexGuard<'_, T> {
127
+ fn drop(&mut self) {
128
+ self.0.locked.store(false, Ordering::Release);
129
+ self.0.lock_ops.notify(1);
130
+ }
131
+}
132
+
133
/// A guard holding a lock.
134
struct MutexGuard<'a, T>(&'a Mutex<T>);
135
0 commit comments