mutex

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecursiveMutex

type RecursiveMutex struct {
	sync.Mutex // 嵌入Mutex以提供基础互斥功能
	// contains filtered or unexported fields
}

RecursiveMutex 包装一个Mutex,实现可重入

func (*RecursiveMutex) Lock

func (m *RecursiveMutex) Lock()

Lock 获取锁,支持同goroutine多次获取(重入)

func (*RecursiveMutex) Unlock

func (m *RecursiveMutex) Unlock()

Unlock 释放锁,只有当递归计数归零时才真正释放

Jump to

Keyboard shortcuts

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