Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MutexLock ¶
type MutexLock struct {
// contains filtered or unexported fields
}
MutexLock is a simple sync.RWMutex + ability to try to Lock.
func (*MutexLock) Lock ¶
func (m *MutexLock) Lock()
Lock locks for writing. If the lock is already locked for reading or writing, Lock blocks until the lock is available.
func (*MutexLock) RLock ¶
func (m *MutexLock) RLock()
RLock locks for reading. If the lock is already locked for writing, RLock blocks until the lock is available.
func (*MutexLock) RTryLock ¶ added in v1.2.0
RTryLock tries to lock for reading. It returns true in case of success, false if timeout. A negative timeout means no timeout. If timeout is 0 that means try at once and quick return.
func (*MutexLock) RUnlock ¶
func (m *MutexLock) RUnlock()
RUnlock unlocks for reading. It is a panic if m is not locked for reading on entry to Unlock.
func (*MutexLock) TryLock ¶
TryLock tries to lock for writing. It returns true in case of success, false if timeout. A negative timeout means no timeout. If timeout is 0 that means try at once and quick return. If the lock is currently held by another goroutine, TryLock will wait until it has a chance to acquire it.