mutex

package
v0.0.0-...-fcd50c7 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

包mutex为sync.Mutex提供了并发安全开关的功能。 md5:2d280f557de1d7a8

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是一个带有并发安全功能开关的sync.Mutex。 md5:8889db913bd4aa9f

func Create

func Create(safe ...bool) Mutex

Create 创建并返回一个新的 Mutex 对象。 参数 `safe` 用于指定是否在并发安全的环境下使用此 mutex,默认为 false。 md5:a3db2fe6cfb0197f

func New

func New(safe ...bool) *Mutex

New 创建并返回一个新的 *Mutex。 参数 `safe` 用于指定是否在并发安全情况下使用此互斥锁,其默认值为 false。 md5:4b9e38d55d8b7828

func (*Mutex) IsSafe

func (mu *Mutex) IsSafe() bool

IsSafe 检查并返回当前互斥锁是否在并发安全的使用中。 md5:1a2c4197eb3278b5

func (*Mutex) Lock

func (mu *Mutex) Lock()

Lock 为写入锁定互斥量。如果没有进行并发安全使用,它不会做任何事情。 md5:e7a0e420dc8d74c3

func (*Mutex) Unlock

func (mu *Mutex) Unlock()

Unlock 为写操作解锁互斥锁。如果它不是在并发安全模式下使用,则不会做任何事情。 md5:ce0b3215f968f29c

Jump to

Keyboard shortcuts

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