mutexlock

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

* * Package mutexlock mutex trylock. * 在sync.Mutex基础上,实现乐观锁TryLock

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

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

Mutex mutex

func NewMutexLock

func NewMutexLock() *Mutex

NewMutexLock 创建lock实例

func (*Mutex) Lock

func (m *Mutex) Lock()

Lock 加锁

func (*Mutex) TryLock

func (m *Mutex) TryLock() bool

TryLock 尝试枷锁

func (*Mutex) Unlock

func (m *Mutex) Unlock()

Unlock 解锁

Jump to

Keyboard shortcuts

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