Skip to content

Commit

Permalink
Check if lock is orphaned
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Manuel Velarde Polar authored and eduardo-vp committed Sep 26, 2024
1 parent 7c85cee commit b7ddaaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/vm/syncblk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ BOOL ObjHeader::GetThreadOwningMonitorLock(DWORD *pThreadId, DWORD *pAcquisition

_ASSERTE(psb->GetMonitor() != NULL);
Thread* pThread = psb->GetMonitor()->GetHoldingThread();
if(pThread == NULL)
if(pThread == NULL || pThread == (Thread*) -1) // -1 means the lock is orphaned
{
*pThreadId = 0;
*pAcquisitionCount = 0;
Expand Down

0 comments on commit b7ddaaa

Please sign in to comment.