concurrency

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

type Mutex struct {
	// contains filtered or unexported fields
}

Mutex represents a mutual exclusion lock

func NewMutex

func NewMutex() *Mutex

NewMutex creates a new mutex

func (*Mutex) Equals

func (m *Mutex) Equals(other types.Object) bool

Equals implements types.Object interface

func (*Mutex) Lock

func (m *Mutex) Lock()

Lock acquires the mutex

func (*Mutex) ToStr

func (m *Mutex) ToStr() string

ToStr implements types.Object interface

func (*Mutex) TryLock

func (m *Mutex) TryLock() bool

TryLock attempts to acquire the mutex without blocking

func (*Mutex) TypeCode

func (m *Mutex) TypeCode() uint8

TypeCode implements types.Object interface

func (*Mutex) TypeName

func (m *Mutex) TypeName() string

TypeName implements types.Object interface

func (*Mutex) Unlock

func (m *Mutex) Unlock()

Unlock releases the mutex

type RWMutex

type RWMutex struct {
	// contains filtered or unexported fields
}

RWMutex represents a reader/writer mutual exclusion lock

func NewRWMutex

func NewRWMutex() *RWMutex

NewRWMutex creates a new read-write mutex

func (*RWMutex) Equals

func (m *RWMutex) Equals(other types.Object) bool

Equals implements types.Object interface

func (*RWMutex) Lock

func (m *RWMutex) Lock()

Lock acquires a write lock

func (*RWMutex) RLock

func (m *RWMutex) RLock()

RLock acquires a read lock

func (*RWMutex) RUnlock

func (m *RWMutex) RUnlock()

RUnlock releases a read lock

func (*RWMutex) ToStr

func (m *RWMutex) ToStr() string

ToStr implements types.Object interface

func (*RWMutex) TryLock

func (m *RWMutex) TryLock() bool

TryLock attempts to acquire a write lock without blocking

func (*RWMutex) TryRLock

func (m *RWMutex) TryRLock() bool

TryRLock attempts to acquire a read lock without blocking

func (*RWMutex) TypeCode

func (m *RWMutex) TypeCode() uint8

TypeCode implements types.Object interface

func (*RWMutex) TypeName

func (m *RWMutex) TypeName() string

TypeName implements types.Object interface

func (*RWMutex) Unlock

func (m *RWMutex) Unlock()

Unlock releases a write lock

Jump to

Keyboard shortcuts

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