locking

package
v0.0.0-...-957f62e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0, MIT Imports: 5 Imported by: 0

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

func AddGLock

func AddGLock(*MutexClass, int)

AddGLock is no-op without the lockdep tag.

func DelGLock

func DelGLock(*MutexClass, int)

DelGLock is no-op without the lockdep tag.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL