Documentation
¶
Overview ¶
Package rwmutex provides switch of concurrent safe feature for sync.RWMutex.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RWMutex ¶
RWMutex is a sync.RWMutex with a switch of concurrent safe feature.
func New ¶
New creates and returns a new *RWMutex. The parameter <safe> is used to specify whether using this mutex in concurrent-safety, which is false in default.
func (*RWMutex) IsSafe ¶
IsSafe checks and returns whether current mutex is in concurrent-safe usage.
func (*RWMutex) Lock ¶
func (mu *RWMutex) Lock()
Lock locks mutex for writing. It does nothing if it is not in concurrent-safe usage.
func (*RWMutex) RLock ¶
func (mu *RWMutex) RLock()
RLock locks mutex for reading. It does nothing if it is not in concurrent-safe usage.
Click to show internal directories.
Click to hide internal directories.