Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Opts = struct { // -- almost no runtime penalty, no deadlock detection if Disable == true. Disable bool // Waiting for a lock for longer than DeadlockTimeout is considered a deadlock. // Ignored if DeadlockTimeout <= 0. DeadlockTimeout time.Duration // The rate at which chanlock's ticker executes. HealthCheckRate time.Duration // OnPotentialDeadlock is called each time a potential deadlock is detected -- either based on // lock order or on lock wait time. OnPotentialDeadlock func() // Will keep MaxMapSize lock pairs (happens before // happens after) in the map. // The map resets once the threshold is reached. MaxMapSize int // Will dump stacktraces of all goroutines when inconsistent locking is detected. PrintAllCurrentGoroutines bool mu *sync.Mutex // Protects the LogBuf. // Will print deadlock info to log buffer. LogBuf io.Writer }{ DeadlockTimeout: time.Second * 30, HealthCheckRate: time.Second * 1, OnPotentialDeadlock: func() { os.Exit(2) }, MaxMapSize: 1024 * 64, LogBuf: os.Stderr, // contains filtered or unexported fields }
Opts control how deadlock detection behaves. Options are supposed to be set once at a startup (say, when parsing flags).
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.