PoisonErrorRwLockReadGuardT
PoisonError is a type in the Rust standard library that represents the situation where a synchronization primitive has been poisoned after a thread panicked. In the context of an RwLock (read-write lock), poisoning occurs when a thread panics while holding either the read lock or the write lock. If the lock is poisoned, other threads attempting to acquire the lock receive an error of the form Err(PoisonError<Guard>), where Guard is either a RwLockReadGuard or a RwLockWriteGuard.
A PoisonError conveys that the guarded data may have been left in an inconsistent state due to
Handling strategies vary. Some code propagates the poisoning error to callers, signaling that recovery is needed
Notes for practice: poisoning is per lock, and a lock can become poisoned if a thread panics