mutex

package
v0.0.0-...-ff439f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Disabled int32 = iota - 1
	Unlocked
	Locked
)

Status constants

Variables

This section is empty.

Functions

This section is empty.

Types

type InitialMutex

type InitialMutex struct {
	sync.Mutex
	// contains filtered or unexported fields
}

InitialMutex is a mutex that can eventually be bypassed. Good for structures that are initially mutable, but thereafter read-only.

func (*InitialMutex) DisableLock

func (m *InitialMutex) DisableLock()

DisableLock instructs the InitialMutex to ignore all subsequent calls to Lock and Unlock

func (*InitialMutex) IsLockDisabled

func (m *InitialMutex) IsLockDisabled() bool

IsLockDisabled returns whether locking has been disabled

func (*InitialMutex) Lock

func (m *InitialMutex) Lock()

Lock potentially locks this InitialMutex, if enabled

func (*InitialMutex) Unlock

func (m *InitialMutex) Unlock()

Unlock potentially unlocks this InitialMutex, if enabled

Jump to

Keyboard shortcuts

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