[CSRSRV] Fix locking logic when destroying threads & processes

This commit is contained in:
Jérôme Gardou 2021-03-23 18:15:23 +01:00 committed by Jérôme Gardou
parent f5bace8536
commit 7054cd10b1
2 changed files with 4 additions and 2 deletions

View file

@ -167,8 +167,9 @@ CsrLockedDereferenceProcess(PCSR_PROCESS CsrProcess)
{
/* Call the generic cleanup code */
DPRINT1("Should kill process: %p\n", CsrProcess);
CsrAcquireProcessLock();
CsrProcessRefcountZero(CsrProcess);
/* Acquire again, the lock it was released in CsrProcessRefcountZero */
CsrAcquireProcessLock();
}
}

View file

@ -474,8 +474,9 @@ CsrLockedDereferenceThread(IN PCSR_THREAD CsrThread)
if (LockCount == 0)
{
/* Call the generic cleanup code */
CsrAcquireProcessLock();
CsrThreadRefcountZero(CsrThread);
/* Acquire the lock again, it was released by CsrThreadRefcountZero */
CsrAcquireProcessLock();
}
}