ctxmu

package
v0.0.0-...-c5b8800 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CtxMutex

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

CtxMutex implements a context aware lock

func New

func New() *CtxMutex

New creates a new CtxMutex

func (*CtxMutex) Lock

func (mu *CtxMutex) Lock(ctx context.Context) bool

Lock acquires a lock, it can be canceled by context

func (*CtxMutex) Locked

func (mu *CtxMutex) Locked() bool

Locked checks whether the lock is hold

func (*CtxMutex) Unlock

func (mu *CtxMutex) Unlock()

Unlock releases the acquired lock

Jump to

Keyboard shortcuts

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