Documentation ¶
Overview ¶
Package state provides index-based state change tracking facilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker provides index-based state tracking using a condition variable.
func NewTracker ¶
func NewTracker() *Tracker
NewTracker creates a new tracker instance with state index 1.
func (*Tracker) NotifyOfChange ¶
func (t *Tracker) NotifyOfChange()
NotifyOfChange indicates the state index and notifies waiters.
type TrackingLock ¶
type TrackingLock struct {
// contains filtered or unexported fields
}
TrackingLock provides locking facilities with automatic state tracking notifications.
func NewTrackingLock ¶
func NewTrackingLock(tracker *Tracker) *TrackingLock
NewTrackingLock creates a new tracking lock with the specified tracker.
func (*TrackingLock) Unlock ¶
func (l *TrackingLock) Unlock()
Unlock unlocks the tracking lock and triggers a state update notification.
func (*TrackingLock) UnlockWithoutNotify ¶
func (l *TrackingLock) UnlockWithoutNotify()
UnlockWithoutNotify unlocks the tracking lock without triggering a state update notification.
Click to show internal directories.
Click to hide internal directories.