nebula
nebula copied to clipboard
Mutex debug
experimental test to see if we can have a test mode that verifies mutexes lock in the order we want, while having no hit on production performance. Since this uses a build tag, it should all compile out during the build process and be a no-op unless the tag is set.
This ensures that we don't do any re-entrant locking, and also that we don't grab two locks of different types unless we expect it to happen (and in a specific order)
If the locks are grabbed in a different order, the debug mutex will panic.