Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MutexWithLock ¶
type MutexWithLock struct {
// contains filtered or unexported fields
}
MutexWithLock is a mutex with a standard mutex.
func NewMutexWithLock ¶
func NewMutexWithLock() *MutexWithLock
NewMutexWithLock creates a new mutex with a standard mutex.
func (*MutexWithLock) TryLock ¶
func (m *MutexWithLock) TryLock() bool
TryLock tries to lock the mutex.
type MutexWithSpinlock ¶
type MutexWithSpinlock struct {
// contains filtered or unexported fields
}
MutexWithSpinlock is a mutex with a spinlock.
func NewMutexWithSpinlock ¶
func NewMutexWithSpinlock() *MutexWithSpinlock
NewMutexWithSpinlock creates a new mutex with a spinlock. It is faster than the standard mutex, but it is CPU-intensive.
func (*MutexWithSpinlock) TryLock ¶
func (m *MutexWithSpinlock) TryLock() bool
TryLock tries to lock the mutex.
type MutexWithoutLock ¶
type MutexWithoutLock struct{}
MutexWithoutLock is a mutex without a lock.
func NewMutexWithoutLock ¶
func NewMutexWithoutLock() *MutexWithoutLock
NewMutexWithoutLock creates a new mutex without a lock.
func (*MutexWithoutLock) TryLock ¶
func (m *MutexWithoutLock) TryLock() bool
TryLock always returns true.
type RWMutexWithLock ¶
type RWMutexWithLock struct {
// contains filtered or unexported fields
}
RWMutexWithLock is a read-write mutex with a standard read-write mutex.
func NewRWMutexWithLock ¶
func NewRWMutexWithLock() *RWMutexWithLock
NewRWMutexWithLock creates a new read-write mutex with a standard read-write mutex.
func (*RWMutexWithLock) RLock ¶
func (m *RWMutexWithLock) RLock()
RLock locks the mutex for reading.
func (*RWMutexWithLock) RUnlock ¶
func (m *RWMutexWithLock) RUnlock()
RUnlock unlocks the mutex for reading.
func (*RWMutexWithLock) TryLock ¶
func (m *RWMutexWithLock) TryLock() bool
TryLock tries to lock the mutex.
func (*RWMutexWithLock) TryRLock ¶
func (m *RWMutexWithLock) TryRLock() bool
TryRLock tries to lock the mutex for reading.
type RWMutexWithoutLock ¶
type RWMutexWithoutLock struct{}
RWMutexWithoutLock is a read-write mutex without a lock.
func NewRWMutexWithoutLock ¶
func NewRWMutexWithoutLock() *RWMutexWithoutLock
NewRWMutexWithoutLock creates a new read-write mutex without a lock.
func (*RWMutexWithoutLock) TryLock ¶
func (m *RWMutexWithoutLock) TryLock() bool
TryLock always returns true.
func (*RWMutexWithoutLock) TryRLock ¶
func (m *RWMutexWithoutLock) TryRLock() bool
TryRLock always returns true.