根据MSDN和Raymond Chen的说法,0 不是有效的线程 ID 。
但是,当我分析转储时,两个死锁临界区之一被锁定,但 OwningThread 为 0。
有人可以帮忙解释一下吗?
> !locks
CritSec ModuleA!lockerA+4 at 58cf4b24
WaiterWoken No
LockCount 230
RecursionCount 0
OwningThread 0
EntryCount 0
ContentionCount e6
*** Locked
CritSec ModuleA!$S2+8 at 58cf4b44
WaiterWoken No
LockCount 0
RecursionCount 1
OwningThread 2154
EntryCount 0
ContentionCount 0
*** Locked
Scanned nnnn critical sections
> !cs 58cf4b24
-----------------------------------------
Critical section = 0x58cf4b24 (ModuleA!lockerA+0x4)
DebugInfo = 0x1cd3d8d0
LOCKED
LockCount = 0xE6
WaiterWoken = No
OwningThread = 0x00000000
RecursionCount = 0x0
LockSemaphore = 0xCDC
SpinCount = 0x00000000
> !cs 58cf4b44
-----------------------------------------
Critical section = 0x58cf4b44 (ModuleA!$S2+0x8)
DebugInfo = 0x1b1f1840
LOCKED
LockCount = 0x0
WaiterWoken = No
OwningThread = 0x00002154
RecursionCount = 0x1
LockSemaphore = 0x0
SpinCount = 0x00000000