Recently, I released version 0.3 of my HappyLock crate on crates.io. In this blog post, I wanted to explain what I changed, and why it works. Background There are four conditions necessary for a deadlock to occur. You only need to prevent one of them in order to prevent all deadlocks: Mutual exclusion Non-preemptive allocation Circular wait Partial allocation Let's go through each one, and see wha