mutexKit

package
v2.1.57 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

type Mutex struct {
	*sync.Mutex
}

func NewMutex

func NewMutex() *Mutex

func (*Mutex) LockFunc

func (m *Mutex) LockFunc(f func())

func (*Mutex) TryLockFunc

func (m *Mutex) TryLockFunc(f func()) (result bool)

type RWMutex

type RWMutex struct {
	*sync.RWMutex
}

func NewRWMutex

func NewRWMutex() *RWMutex

func (*RWMutex) LockFunc

func (m *RWMutex) LockFunc(f func())

LockFunc 写锁

func (*RWMutex) RLockFunc

func (m *RWMutex) RLockFunc(f func())

RLockFunc 读锁

func (*RWMutex) TryLockFunc

func (m *RWMutex) TryLockFunc(f func()) (result bool)

TryLockFunc 写锁

PS: 不管加锁成功还是失败,不会阻塞.

func (*RWMutex) TryRLockFunc

func (m *RWMutex) TryRLockFunc(f func()) (result bool)

TryRLockFunc 读锁

PS: 不管加锁成功还是失败,不会阻塞.

Jump to

Keyboard shortcuts

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