Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSpinLock ¶
NewSpinLock creates a new spin lock. A spin lock calls runtime.Gosched when it failed acquiring the lock, then try again until it succeeds.
Types ¶
type RWLock ¶
type RWLock []rwlockShard
RWLock holds a group of sharded RWMutex, it gives better performance in read-heavy workloads by reducing lock contention, but the performance for exclusive Lock is poor.
func (RWLock) Lock ¶
func (p RWLock) Lock()
Lock locks all underlying mutexes, preparing for exclusive access to the resource protected by the lock.
Click to show internal directories.
Click to hide internal directories.