Phying News
Curated security research, vulnerabilities, advisories and tools for practitioners.

How to check if a mutex is locked in Go

Summary

Go's sync.Mutex can't tell you if it's locked—a deliberate omission due to race conditions. Reflection on the internal state field enables debug-only assertions for mutex preconditions.
Published
Collected

original ↗

Related coverage

back