nebula icon indicating copy to clipboard operation
nebula copied to clipboard

Mutex debug

Open wadey opened this issue 1 year ago • 2 comments

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.

wadey avatar May 09 '23 14:05 wadey