mirror of
https://github.com/reactos/reactos.git
synced 2025-05-21 18:16:07 +00:00
[CSRSRV] Fix locking logic when destroying threads & processes
This commit is contained in:
parent
f5bace8536
commit
7054cd10b1
2 changed files with 4 additions and 2 deletions
|
@ -167,8 +167,9 @@ CsrLockedDereferenceProcess(PCSR_PROCESS CsrProcess)
|
||||||
{
|
{
|
||||||
/* Call the generic cleanup code */
|
/* Call the generic cleanup code */
|
||||||
DPRINT1("Should kill process: %p\n", CsrProcess);
|
DPRINT1("Should kill process: %p\n", CsrProcess);
|
||||||
CsrAcquireProcessLock();
|
|
||||||
CsrProcessRefcountZero(CsrProcess);
|
CsrProcessRefcountZero(CsrProcess);
|
||||||
|
/* Acquire again, the lock it was released in CsrProcessRefcountZero */
|
||||||
|
CsrAcquireProcessLock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -474,8 +474,9 @@ CsrLockedDereferenceThread(IN PCSR_THREAD CsrThread)
|
||||||
if (LockCount == 0)
|
if (LockCount == 0)
|
||||||
{
|
{
|
||||||
/* Call the generic cleanup code */
|
/* Call the generic cleanup code */
|
||||||
CsrAcquireProcessLock();
|
|
||||||
CsrThreadRefcountZero(CsrThread);
|
CsrThreadRefcountZero(CsrThread);
|
||||||
|
/* Acquire the lock again, it was released by CsrThreadRefcountZero */
|
||||||
|
CsrAcquireProcessLock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue