From 2450b5bfc9ee788975d84d4feb87f8820b63bd3f Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 9 Dec 2019 18:13:24 +0100 Subject: sync::Mutex: Add note about the absence of poisoning (#1933) --- tokio/src/sync/mutex.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tokio/src/sync/mutex.rs') diff --git a/tokio/src/sync/mutex.rs b/tokio/src/sync/mutex.rs index 474f5368..cf42c3e1 100644 --- a/tokio/src/sync/mutex.rs +++ b/tokio/src/sync/mutex.rs @@ -26,6 +26,11 @@ //! } //! ``` //! +//! Note that in contrast to `std::sync::Mutex`, this implementation does not +//! poison the mutex when a thread holding the `MutexGuard` panics. In such a +//! case, the mutex will be unlocked. If the panic is caught, this might leave +//! the data protected by the mutes in an inconsistent state. +//! //! [`Mutex`]: struct.Mutex.html //! [`MutexGuard`]: struct.MutexGuard.html -- cgit v1.2.3