The highest tagged major version is
v3.
package
Version:
v2.8.150
Opens a new window with list of versions in this module.
Published: Dec 7, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Mutex 互斥锁.
PS: 结构体中使用此锁,可以考虑"匿名字段".
NewMutex Deprecated: 直接用 &Mutex{} 吧.
func (m *Mutex) LockFunc(f func())
func (m *Mutex) TryLockFunc(f func()) (result bool)
RWMutex 读写锁.
PS: 结构体中使用此锁,可以考虑"匿名字段".
NewRWMutex Deprecated: 直接用 &RWMutex{} 吧.
func (m *RWMutex) LockFunc(f func())
LockFunc 写锁
func (m *RWMutex) RLockFunc(f func())
RLockFunc 读锁
TryLockFunc 写锁
PS: 不管加锁成功还是失败,不会阻塞.
TryRLockFunc 读锁
PS: 不管加锁成功还是失败,不会阻塞.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.