xsync

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 3 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 interface {
	TryLock() bool
	Lock()
	Unlock()
}

Mutex is a mutex interface.

type MutexWithLock

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

MutexWithLock is a mutex with a standard mutex.

func NewMutexWithLock

func NewMutexWithLock() *MutexWithLock

NewMutexWithLock creates a new mutex with a standard mutex.

func (*MutexWithLock) Lock

func (m *MutexWithLock) Lock()

Lock locks the mutex.

func (*MutexWithLock) TryLock

func (m *MutexWithLock) TryLock() bool

TryLock tries to lock the mutex.

func (*MutexWithLock) Unlock

func (m *MutexWithLock) Unlock()

Unlock unlocks the mutex.

type MutexWithSpinlock

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

MutexWithSpinlock is a mutex with a spinlock.

func NewMutexWithSpinlock

func NewMutexWithSpinlock() *MutexWithSpinlock

NewMutexWithSpinlock creates a new mutex with a spinlock. It is faster than the standard mutex, but it is CPU-intensive.

func (*MutexWithSpinlock) Lock

func (m *MutexWithSpinlock) Lock()

Lock locks the mutex.

func (*MutexWithSpinlock) TryLock

func (m *MutexWithSpinlock) TryLock() bool

TryLock tries to lock the mutex.

func (*MutexWithSpinlock) Unlock

func (m *MutexWithSpinlock) Unlock()

Unlock unlocks the mutex.

type MutexWithoutLock

type MutexWithoutLock struct{}

MutexWithoutLock is a mutex without a lock.

func NewMutexWithoutLock

func NewMutexWithoutLock() *MutexWithoutLock

NewMutexWithoutLock creates a new mutex without a lock.

func (*MutexWithoutLock) Lock

func (m *MutexWithoutLock) Lock()

Lock does nothing.

func (*MutexWithoutLock) TryLock

func (m *MutexWithoutLock) TryLock() bool

TryLock always returns true.

func (*MutexWithoutLock) Unlock

func (m *MutexWithoutLock) Unlock()

Unlock does nothing.

type RWMutex

type RWMutex interface {
	TryLock() bool
	Lock()
	Unlock()
	TryRLock() bool
	RLock()
	RUnlock()
}

RWMutex is a read-write mutex interface.

type RWMutexWithLock

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

RWMutexWithLock is a read-write mutex with a standard read-write mutex.

func NewRWMutexWithLock

func NewRWMutexWithLock() *RWMutexWithLock

NewRWMutexWithLock creates a new read-write mutex with a standard read-write mutex.

func (*RWMutexWithLock) Lock

func (m *RWMutexWithLock) Lock()

Lock locks the mutex.

func (*RWMutexWithLock) RLock

func (m *RWMutexWithLock) RLock()

RLock locks the mutex for reading.

func (*RWMutexWithLock) RUnlock

func (m *RWMutexWithLock) RUnlock()

RUnlock unlocks the mutex for reading.

func (*RWMutexWithLock) TryLock

func (m *RWMutexWithLock) TryLock() bool

TryLock tries to lock the mutex.

func (*RWMutexWithLock) TryRLock

func (m *RWMutexWithLock) TryRLock() bool

TryRLock tries to lock the mutex for reading.

func (*RWMutexWithLock) Unlock

func (m *RWMutexWithLock) Unlock()

Unlock unlocks the mutex.

type RWMutexWithoutLock

type RWMutexWithoutLock struct{}

RWMutexWithoutLock is a read-write mutex without a lock.

func NewRWMutexWithoutLock

func NewRWMutexWithoutLock() *RWMutexWithoutLock

NewRWMutexWithoutLock creates a new read-write mutex without a lock.

func (*RWMutexWithoutLock) Lock

func (m *RWMutexWithoutLock) Lock()

Lock does nothing.

func (*RWMutexWithoutLock) RLock

func (m *RWMutexWithoutLock) RLock()

RLock does nothing.

func (*RWMutexWithoutLock) RUnlock

func (m *RWMutexWithoutLock) RUnlock()

RUnlock does nothing.

func (*RWMutexWithoutLock) TryLock

func (m *RWMutexWithoutLock) TryLock() bool

TryLock always returns true.

func (*RWMutexWithoutLock) TryRLock

func (m *RWMutexWithoutLock) TryRLock() bool

TryRLock always returns true.

func (*RWMutexWithoutLock) Unlock

func (m *RWMutexWithoutLock) Unlock()

Unlock does nothing.

Jump to

Keyboard shortcuts

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