Versions in this module Expand all Collapse all v1 v1.0.0 Dec 28, 2025 Changes in this version + var ErrContextCancelled = errors.New("context cancelled during lock acquisition") + var ErrInvalidTimeout = errors.New("invalid timeout duration") + var ErrLockAlreadyHeld = errors.New("lock is already held") + var ErrLockNotHeld = errors.New("lock is not currently held") + var ErrLockTimeout = errors.New("failed to acquire lock within timeout") + type ContextError struct + Cause error + Operation string + func NewContextError(operation string, cause error) *ContextError + func (e *ContextError) Error() string + func (e *ContextError) Unwrap() error + type LockTimeoutError struct + ElapsedTime time.Duration + Message string + Timeout time.Duration + func NewLockTimeoutError(timeout, elapsed time.Duration, message string) *LockTimeoutError + func (e *LockTimeoutError) Error() string + func (e *LockTimeoutError) Is(target error) bool + func (e *LockTimeoutError) Unwrap() error + type TimedLock struct + func New() *TimedLock + func (t *TimedLock) Lock(ctx context.Context, acquireTimeout time.Duration) error + func (t *TimedLock) LockWithAutoRelease(ctx context.Context, acquireTimeout time.Duration, ...) error + func (t *TimedLock) TryLock() bool + func (t *TimedLock) Unlock()