Email or username:

Password:

Forgot your password?
Top-level
chrysn

@Mara That poison clearing needed a lot of mental gymnastics to see why this is not unsafe.
I'd describe it as "Mutex users already have to make sure to always have their &mut T usable, or at least have to fix that during unwinding, and if the mutex is poisoned, that means that the thread that poisoned it unwound". Does that sound about right?

2 comments
Mara

@chrysn Yes, poisoning isn't needed for soundness. No type should cause unsoundness because of unwinding. It's the same reason that AssertUnwindSafe is not unsafe. (The "safe" in "AssertUnwindSafe" is confusing, but it's unrelated to Rust's normal concept of memory (un)safety.)

[object Object]
@chrysn @Mara you could already retrieve the poisoned value previously, as part of the error returned when trying to acquire the lock of a poisoned Mutex. I don't think clearing the flag could possibly cause a new problem that didn't exist before
Go Up