After some recent discussion on the topic of mutex poisoning and notably a blog post that I thought was interesting, thoughtful, exhaustive, yet completely disagreed with, I wanted to comment on the debate myself. To me, poisoning-by-default is one of biggest mistakes that were made in the language, next to some others that are a story for a different time.
I’m confused by this.
saa::Lockdoes support poisoning, but it appears to be manual. You need to both manually mark it as poisoned vialock.poison_lock()and manually check if it’s poisoned with the return value from locking. You can easily ignore poisoning entirely - it’s actually more opt-in rather than forced on you. So sure this supports poisoning, but it’s not forced on you likestd::sync::Mutex, andsaa::Lockisn’t anything close to a completeMutexalternative anyway.It seems to support
lock_apiapparently (presumably as the locking implementations behind it?), butlock_api::Mutexdoesn’t appear to support poisoning at all.