Documentation
¶
Overview ¶
Package deadlock is a set of simple utilities meant to detect deadlocks based on timeouts.
Index ¶
Constants ¶
View Source
const Timeout = 10 * time.Minute
Timeout is the default time after which a function is assumed to have deadlock.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
A Monitor is used to monitor a goroutine and ensure it completes various sections of code (called monitored code) within the specified timeout. To use this, create a new Monitor type for each goroutine, and modify the goroutine to record when it enters or exists monitored code.
func NewMonitor ¶
NewMonitor returns a new monitor for the goroutine.
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
A Timer is used to time a function, and declare a deadlock if it does not return in the specified amount of time.
Click to show internal directories.
Click to hide internal directories.