locking

package
v0.0.0-...-288c4de Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnlockFunc

type UnlockFunc func()

UnlockFunc unlocks the lock.

func Lock

func Lock(ctx context.Context, lockName string) UnlockFunc

Lock creates a named lock to allow activities that require exclusive access to occur. Will block until the lock is established or the context is cancelled. On successfully acquiring the lock, it returns an unlock function which needs to be called to unlock the lock. If the context is canceled then nil will be returned.

Jump to

Keyboard shortcuts

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