Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TimedMutex ¶
type TimedMutex struct {
// contains filtered or unexported fields
}
TimedMutex is a mutex which dumps a stack trace whenever a lock is unlocked after being held for longer than the supplied duration, which must be strictly positive.
func MakeTimedMutex ¶
func MakeTimedMutex(ctx context.Context, warnDuration time.Duration) TimedMutex
MakeTimedMutex creates a TimedMutex which warns when an Unlock happens more than warnDuration after the corresponding lock. It will use the supplied context for the warning message; see SetLogger().
Click to show internal directories.
Click to hide internal directories.