lock

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapLock

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

MapLock 字典锁:一个锁的集合

var (
	MapLockApp MapLock
)

func (MapLock) Demo

func (MapLock) Demo()

func (*MapLock) Destroy

func (r *MapLock) Destroy(key string)

Destroy 删除锁

func (*MapLock) DestroyAll

func (r *MapLock) DestroyAll()

DestroyAll 删除所有锁

func (*MapLock) Lock

func (r *MapLock) Lock(key string, timeout time.Duration) (*itemLock, error)

Lock 获取锁

func (MapLock) New

func (MapLock) New() *MapLock

New 实例化:字典锁

func (MapLock) Once

func (MapLock) Once() *MapLock

Once 单例化:字典锁

func (*MapLock) Set added in v2.2.5

func (r *MapLock) Set(key string, val any) error

Set 创建锁

func (*MapLock) SetMany added in v2.2.5

func (r *MapLock) SetMany(items map[string]any) error

SetMany 批量创建锁

func (*MapLock) Try

func (r *MapLock) Try(key string) error

Try 尝试获取锁

Jump to

Keyboard shortcuts

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