locker

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Provides the Locker implementations with optional debug utils.

Provides the RWLocker implementations with optional debug utils.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableDebugMessages

func EnableDebugMessages()

Enable the debug messages to diagnose dead locks. Must be set before creating any lockers.

func EnableInvariantsCheck

func EnableInvariantsCheck()

Enable the check for invariants in the locks. Must be set before creating any lockers.

Types

type Locker

type Locker sync.Locker

func New

func New(name string, check func()) Locker

Returns a locker with potential capability for debugging.

type RWLocker

type RWLocker interface {
	sync.Locker
	RLock()
	RUnlock()
}

func NewRW

func NewRW(name string, check func()) RWLocker

NewRW returns a RW locker with potential capability for debugging.

Note: The deadlock detection is done only for writer lock and not for reader lock.

Jump to

Keyboard shortcuts

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