Deadlock DetectorDeadlock Detector is a static code analysis program that examines .NET assemblies and tries to detect patterns that would result in a deadlock. Currently, it looks for lock statements and detects locks acquired in the wrong order. For e.g.
void MethodA()
{
lock(x)
{
lock(y)
{}
}
}
void MethodB()
{
lock(y)
{
lock(x)
{}
}
}
Deadlock Detector is a command line app that takes the assembly to analyze as the parameter. It then proceeds to analyze all methods in all types in the target assembly, following the flow of control, loading referenced assemblies and their types/methods, if necessary.