Identify the thread which holds the lock

后端 未结 6 1041
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-25 11:03

one of the threads in my application blocked at the following lock statement and resulted in a deadlock

void ExecuteCommand()
{
    lock(this._lockinstance)
         


        
6条回答
  •  执念已碎
    2020-12-25 11:19

    Yes, there is a 'Threads' view that you can use in VS. Break anywhere in your application (or click the 'Break All' button) then you can select each thread and view who has the lock (if anyone).

    To add it, go to Debug > Windows > Threads (Ctrl+D,T)

提交回复
热议问题