Hacker News new | ask | show | jobs
by Maledictus 436 days ago
Could you create a type around Mutex that enforces the locking order?
2 comments

You could - and this is what we do - push all of your state into one large struct. Note that this has drawbacks as well and if you have a lot of reads and some very important writes, you will still get deadlocks.