csync

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMutex

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

RWMutex implements a RWMutex with a Broadcast. Implements a RWMutex that accepts a Context. An empty value RWMutex{} is valid.

func (*RWMutex) Lock

func (m *RWMutex) Lock(ctx context.Context, write bool) (func(), error)

Lock attempts to hold a lock on the RWMutex. Returns a lock release function or an error. A single writer OR many readers can hold Lock at a time. If a writer is waiting to lock, readers will wait for it.

func (*RWMutex) Locker

func (m *RWMutex) Locker() sync.Locker

Locker returns an RWMutexLocker that uses context.Background to write lock the RWMutex.

func (*RWMutex) RLocker

func (m *RWMutex) RLocker() sync.Locker

RLocker returns an RWMutexLocker that uses context.Background to read lock the RWMutex.

func (*RWMutex) TryLock

func (m *RWMutex) TryLock(write bool) (func(), bool)

TryLock attempts to hold a lock on the RWMutex. Returns a lock release function or nil if the lock could not be grabbed. A single writer OR many readers can hold Lock at a time. If a writer is waiting to lock, readers will wait for it.

type RWMutexLocker

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

RWMutexLocker implements Locker for a RWMutex.

func (*RWMutexLocker) Lock

func (l *RWMutexLocker) Lock()

Lock implements the sync.Locker interface.

func (*RWMutexLocker) Unlock

func (l *RWMutexLocker) Unlock()

Unlock implements the sync.Locker interface.

Jump to

Keyboard shortcuts

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