Documentation ¶
Index ¶
- func ReceiveFromChanWhenDone(callback func()) <-chan struct{}
- type PriorityMutex
- func (mtx *PriorityMutex) HighPriorityReadLock()
- func (mtx *PriorityMutex) HighPriorityReadUnlock()
- func (mtx *PriorityMutex) HighPriorityWriteLock()
- func (mtx *PriorityMutex) HighPriorityWriteUnlock()
- func (mtx *PriorityMutex) LowPriorityWriteLock()
- func (mtx *PriorityMutex) LowPriorityWriteUnlock()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReceiveFromChanWhenDone ¶
func ReceiveFromChanWhenDone(callback func()) <-chan struct{}
ReceiveFromChanWhenDone takes a blocking function and returns a channel that sends an empty struct when the function is done.
Types ¶
type PriorityMutex ¶
type PriorityMutex struct {
// contains filtered or unexported fields
}
PriorityMutex implements a lock with three priorities:
- High priority write lock - locks the mutex with the highest priority.
- High priority read lock - locks the mutex with lower priority than the high priority write lock. Can be held concurrently with other with other read locks.
- Low priority write lock - locks the mutex with lower priority then the read lock.
func NewPriorityMutex ¶
func NewPriorityMutex() *PriorityMutex
NewPriorityMutex returns a new priority mutex
func (*PriorityMutex) HighPriorityReadLock ¶
func (mtx *PriorityMutex) HighPriorityReadLock()
HighPriorityReadLock acquires a high-priority read lock.
func (*PriorityMutex) HighPriorityReadUnlock ¶
func (mtx *PriorityMutex) HighPriorityReadUnlock()
HighPriorityReadUnlock unlocks the high-priority read lock
func (*PriorityMutex) HighPriorityWriteLock ¶
func (mtx *PriorityMutex) HighPriorityWriteLock()
HighPriorityWriteLock acquires a high-priority write lock.
func (*PriorityMutex) HighPriorityWriteUnlock ¶
func (mtx *PriorityMutex) HighPriorityWriteUnlock()
HighPriorityWriteUnlock unlocks the high-priority write lock
func (*PriorityMutex) LowPriorityWriteLock ¶
func (mtx *PriorityMutex) LowPriorityWriteLock()
LowPriorityWriteLock acquires a low-priority write lock.
func (*PriorityMutex) LowPriorityWriteUnlock ¶
func (mtx *PriorityMutex) LowPriorityWriteUnlock()
LowPriorityWriteUnlock unlocks the low-priority write lock
Click to show internal directories.
Click to hide internal directories.