Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BiasedMutex ¶
type BiasedMutex struct {
// contains filtered or unexported fields
}
BiasedMutex is a RWMutex that allows tuning progress making on both writing and reading side. Tries to let through multiple readers and then multiple writers.
BiasedMutex controls the flow by keeping track on how many reads / writes there have been. Once there have been RLock()-s called over `ReaderThreshold`, then RLock will wait in cased there are any writes pending. BiasedMutex will continue letting through at most `WriterThreshold` writers. Once writers have been exhausted the variables are reset.
func NewBiasedMutex ¶
func NewBiasedMutex() *BiasedMutex
func (*BiasedMutex) Lock ¶
func (m *BiasedMutex) Lock()
func (*BiasedMutex) RLock ¶
func (m *BiasedMutex) RLock()
func (*BiasedMutex) RUnlock ¶
func (m *BiasedMutex) RUnlock()
func (*BiasedMutex) SetReaderThreshold ¶
func (m *BiasedMutex) SetReaderThreshold(x int)
func (*BiasedMutex) SetWriterThreshold ¶
func (m *BiasedMutex) SetWriterThreshold(x int)
func (*BiasedMutex) Unlock ¶
func (m *BiasedMutex) Unlock()
Click to show internal directories.
Click to hide internal directories.