sync

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMutex added in v0.4.1

type RWMutex struct {
	sync.RWMutex
}

RWMutex is a sync.RWMutex whose writers can wait a bounded time for the lock with TryLockFor.

func (*RWMutex) TryLockFor added in v0.4.1

func (rw *RWMutex) TryLockFor(ctx context.Context, d time.Duration) bool

TryLockFor is like TryLock but keeps trying for up to d, or until ctx is done, so a lock held briefly by another writer does not fail the caller. It polls rather than waits in Lock, so the lock cannot be held up by callers that have given up. It returns whether it locked rw.

Jump to

Keyboard shortcuts

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