Start with the idea
A standard Mutex becomes poisoned when a holder panics. Recovery is possible, but code must decide whether the protected invariant is still trustworthy instead of blindly ignoring the signal.
A standard-library Mutex becomes poisoned if a thread panics while holding its guard. A subsequent lock() returns a PoisonError rather than silently claiming the protected state is sound. The bytes are still there, and the error can give access to the guard, but the application must decide whether its invariant survived. Poisoning is a warning about a possible inconsistency, not proof that the data is corrupt.
Imagine a bank ledger with two fields updated under one lock.
Keep learning, for free
The rest of this lesson is waiting for you.
Create a free account to read the complete explanation, see the infographic, explore the code, and try the exercises. All 742 lessons and algorithm steps are included.
No payment details. Your account opens the complete Academy.