Documentation ¶
Index ¶
- func FindPotentialDeadlocks()
- func SetActivated(enable bool) bool
- func SetCollectCallStack(enable bool) bool
- func SetCollectSingleLevelLockInformation(enable bool) bool
- func SetComprehensiveDetection(enable bool) bool
- func SetDoubleLockingDetection(enable bool) bool
- func SetMaxCallStackSize(number int) bool
- func SetMaxDependencies(number int) bool
- func SetMaxNumberOfDependentLocks(number int) bool
- func SetMaxRoutines(number int) bool
- func SetPeriodicDetection(enable bool) bool
- func SetPeriodicDetectionTime(seconds int) bool
- type Mutex
- type RWMutex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindPotentialDeadlocks ¶
func FindPotentialDeadlocks()
FindPotentialDeadlock is the main function to start the comprehensive detection of deadlocks. The comprehensive detection uses depth-first search to search for loop in the dependency chains of the created lock trees, which are represented by the dependency lists of the routines. It has to be run at the end of a program to detect potential deadlocks in the program. This can be one by calling it as a defer statement at the beginning of the main function of the program.
Returns: nil
func SetActivated ¶
Enable or disable all detections It is not possible to set options after the detector was initialized
Args: enable (bool): true to enable, false to disable Returns: (bool): true, if the set was successful, false otherwise
func SetCollectCallStack ¶
Enable or disable collection of full call stacks If it is disabled only file and line numbers are collected It is not possible to set options after the detector was initialized
Args: enable (bool): true to enable, false to disable Returns: (bool): true, if the set was successful, false otherwise
func SetCollectSingleLevelLockInformation ¶
Enable or disable collection of call information for single level locks If it is disabled no caller information about single level locks will be collected. It is not possible to set options after the detector was initialized
Args: enable (bool): true to enable, false to disable Returns: (bool): true, if the set was successful, false otherwise
func SetComprehensiveDetection ¶
Enable or disable comprehensive detection It is not possible to set options after the detector was initialized
Args: enable (bool): true to enable, false to disable Returns: (bool): true, if the set was successful, false otherwise
func SetDoubleLockingDetection ¶
Enable or disable checks for double locking It is not possible to set options after the detector was initialized
Args: enable (bool): true to enable, false to disable Returns: (bool): true, if the set was successful, false otherwise
func SetMaxCallStackSize ¶
Set the max size of collected call stacks It is not possible to set options after the detector was initialized
Args: number (int): max size of the call stack in bytes Returns: (bool): true, if the set was successful, false otherwise
func SetMaxDependencies ¶
Set the max number of dependencies It is not possible to set options after the detector was initialized
Args: number (int): max number of dependencies Returns: (bool): true, if the set was successful, false otherwise
func SetMaxNumberOfDependentLocks ¶
Set the max number of locks a lock can depend on It is not possible to set options after the detector was initialized
Args: number (int): max number of locks a lock can depend on Returns: (bool): true, if the set was successful, false otherwise
func SetMaxRoutines ¶
Set the max number of routines It is not possible to set options after the detector was initialized
Args: number (int): max number of routines Returns: (bool): true, if the set was successful, false otherwise
func SetPeriodicDetection ¶
Enable or disable periodic detection It is not possible to set options after the detector was initialized
Args: enable (bool): true to enable, false to disable Returns: (bool): true, if the set was successful, false otherwise
func SetPeriodicDetectionTime ¶
Set the temporal distance between the periodic detections It is not possible to set options after the detector was initialized
Args: seconds (int): temporal distance in seconds Returns: (bool): true, if the set was successful, false otherwise
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Type to implement a lock It can be used as an drop in replacement TODO: check if this can be lowercase
func NewLock ¶
func NewLock() *Mutex
create and return a new lock, which can be used as a drop-in replacement for sync.Mutex
Returns: (*Mutex): the created lock
type RWMutex ¶
type RWMutex struct {
// contains filtered or unexported fields
}
type to implement a lock
func (*RWMutex) RTryLock ¶
TryLock rw-mutex m
Returns: (bool): true if locking was successful, false otherwise