Documentation ¶
Overview ¶
Package locking implements lock primitives with the correctness validator.
All mutexes are divided on classes and the validator check following conditions:
- Mutexes of the same class are not taken more than once except cases when that is expected.
- Mutexes are never locked in a reverse order. Lock dependencies are tracked on the class level.
The validator is implemented in a very straightforward way. For each mutex class, we maintain the ancestors list of all classes that have ever been taken before the target one. For each goroutine, we have the list of currently locked mutexes. And finally, all lock methods check that ancestors of currently locked mutexes don't contain the target one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MutexClass ¶
type MutexClass struct{}
MutexClass is a stub class without the lockdep tag.
func NewMutexClass ¶
func NewMutexClass(reflect.Type, []string) *MutexClass
NewMutexClass is no-op without the lockdep tag.
Click to show internal directories.
Click to hide internal directories.