Explain, please! SyncBlk windbg team

Firstly, is there a command to get help and parameters for each sos command in windbg?

Secondly, I would like to understand the !syncblkoutput

Index SyncBlock MonitorHeld Recursion Owning Thread Info  SyncBlock Owner
  201 05b9493c          979         1 05bc1040   bcc  45   022f3490 System.Collections.ArrayList
 2875 05b4c914            1         1 17b99e10  1af8 290   024862d8 MyClass
 2945 05b4b66c            1         1 17d1a290  12c0 752   02482940 MyClass

MonitorHeldshows # monitor being held synblk. 1 for writing and 2 for reading, but what does the rest of the column mean?

Say I have C # code

MyClass MyObj;
MyObj = new MyClass();

Now if i do

lock (MyObj)
{
}

Will the owner column syncblkshow "MyClass"? Similarly, when I run this command !syncblk, what exactly does this show me? Does my number lock()and Monitor.Enterand Mutex() and the other locking mechanisms?

+5
source share
1 answer

SOS !help !sos.help. !help <command>. SOS . - . !help syncblk.

!syncblk ( # 1 ), , ( # 2).

                                      +-------#1-------+  +-----#2------+
Index SyncBlock MonitorHeld Recursion Owning Thread Info  SyncBlock Owner
  201 05b9493c          979         1 05bc1040   bcc  45   022f3490 System.Collections.ArrayList
 2875 05b4c914            1         1 17b99e10  1af8 290   024862d8 MyClass
 2945 05b4b66c            1         1 17d1a290  12c0 752   02482940 MyClass

1) - , - , - WinDbg.

2) - , , - .

!syncblk .NET, Mutex ( ) .

, , MyObj, , MyClass.

+7

All Articles