Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) ReadAndUpdate ¶
ReadAndUpdate holds RLock and calls Update which uses Lock
type DataManager ¶
type DataManager struct {
// contains filtered or unexported fields
}
func (*DataManager) InternalWrite ¶
func (d *DataManager) InternalWrite(value int)
InternalWrite also uses Lock on the same mutex
func (*DataManager) WriteData ¶
func (d *DataManager) WriteData(value int)
WriteData holds Lock and calls InternalWrite
type MultiMutex ¶
type MultiMutex struct {
// contains filtered or unexported fields
}
func (*MultiMutex) UsesFirstMutex ¶
func (m *MultiMutex) UsesFirstMutex()
UsesFirstMutex holds lock on mu1 and calls UsesSecondMutex
func (*MultiMutex) UsesSecondMutex ¶
func (m *MultiMutex) UsesSecondMutex()
UsesSecondMutex uses a different mutex (mu2)
type SafeCounter ¶
type SafeCounter struct {
// contains filtered or unexported fields
}
func (*SafeCounter) CalculateNewValue ¶
func (s *SafeCounter) CalculateNewValue() int
CalculateNewValue reads value safely and returns new value
func (*SafeCounter) SafeIncrement ¶
func (s *SafeCounter) SafeIncrement()
SafeIncrement calls helper function BEFORE acquiring lock
type TestStruct ¶
type TestStruct struct {
// contains filtered or unexported fields
}
func (*TestStruct) ChildFunction ¶
func (t *TestStruct) ChildFunction() string
ChildFunction also uses RLock on the same mutex
func (*TestStruct) ParentFunction ¶
func (t *TestStruct) ParentFunction() string
ParentFunction holds RLock and calls ChildFunction
Click to show internal directories.
Click to hide internal directories.