rwmutex

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMutex

type RWMutex struct {
	*sync.RWMutex
}

RWMutex 读写锁

func Create

func Create(safe ...bool) RWMutex

Create 创建读写锁,传入的 safe表示该读写锁是否支持并发安全,默认是 false

func New

func New(safe ...bool) *RWMutex

New 创建读写锁,传入的 safe表示该读写锁是否支持并发安全,默认是 false

func (*RWMutex) IsSafe

func (that *RWMutex) IsSafe() bool

IsSafe 判断该锁是否是并发安全锁

func (*RWMutex) Lock

func (that *RWMutex) Lock()

Lock 加锁 如果不是并发安全锁,则什么都不做

func (*RWMutex) RLock

func (that *RWMutex) RLock()

RLock 读加锁 如果不是并发安全锁,则什么都不做

func (*RWMutex) RUnlock

func (that *RWMutex) RUnlock()

RUnlock 读解锁 如果不是并发安全锁,则什么都不做

func (*RWMutex) Unlock

func (that *RWMutex) Unlock()

Unlock 解锁 如果不是并发安全锁,则什么都不做

Jump to

Keyboard shortcuts

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