Wednesday, October 17, 2007

Deadlock from hell

Thread 1:
lock (a)
{

lock (b)
{
lock (c)
{
//some code
}
}
}

Thread 2:
lock (d)
{
lock (c)
{
lock (b)
{
//some code
}
}
}


Main thread:
lock (a)
{
//important code
}

No comments: