Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockWatcher ¶
type LockWatcher struct { LockWatcherOptions // contains filtered or unexported fields }
func New ¶
func New(lock sync.Locker, options LockWatcherOptions) *LockWatcher
func (*LockWatcher) GetOptions ¶
func (lw *LockWatcher) GetOptions() LockWatcherOptions
func (*LockWatcher) GetStats ¶
func (lw *LockWatcher) GetStats() LockWatcherStats
func (*LockWatcher) Stop ¶
func (lw *LockWatcher) Stop()
type LockWatcherOptions ¶
type LockWatcherOptions struct { CheckInterval time.Duration // Default: 5 seconds, minimum: 1 second. Function func() Logger log.DebugLogger RFunction func() LogTimeout time.Duration // Default: 1 second, min: 1 millisecond. MaximumTryInterval time.Duration // Default/maximum: LogTimeout/32. MinimumTryInterval time.Duration // Default/maximum: LogTimeout/256. }
type LockWatcherStats ¶
type LockWatcherStats struct { NumLockTimeouts uint64 // Populated for sync.Mutex NumRLockTimeouts uint64 // Populated for sync.RWMutex NumWLockTimeouts uint64 // Populated for sync.RWMutex WaitingForLock bool // Populated for sync.Mutex WaitingForRLock bool // Populated for sync.RWMutex WaitingForWLock bool // Populated for sync.RWMutex }
Click to show internal directories.
Click to hide internal directories.