mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[WIN32K]
Simplify the loop to remove the THREADINFO from the PROCESSINFO's list when cleaning up svn path=/trunk/; revision=53207
This commit is contained in:
@@ -368,32 +368,28 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
|
||||
}
|
||||
else
|
||||
{
|
||||
PTHREADINFO pti;
|
||||
PTHREADINFO *ppti;
|
||||
PSINGLE_LIST_ENTRY psle;
|
||||
PPROCESSINFO ppiCurrent;
|
||||
|
||||
DPRINT("Destroying W32 thread TID:%d at IRQ level: %lu\n", Thread->Cid.UniqueThread, KeGetCurrentIrql());
|
||||
|
||||
ppiCurrent = ptiCurrent->ppi;
|
||||
ptiCurrent->TIF_flags |= TIF_INCLEANUP;
|
||||
pti = ptiCurrent->ppi->ptiList;
|
||||
if (pti == ptiCurrent)
|
||||
|
||||
/* Find the THREADINFO in the PROCESSINFO's list */
|
||||
ppti = &ppiCurrent->ptiList;
|
||||
while (*ppti != NULL && *ppti != ptiCurrent)
|
||||
{
|
||||
ptiCurrent->ppi->ptiList = ptiCurrent->ptiSibling;
|
||||
ptiCurrent->ppi->cThreads--;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
if (pti->ptiSibling == ptiCurrent)
|
||||
{
|
||||
pti->ptiSibling = ptiCurrent->ptiSibling;
|
||||
ptiCurrent->ppi->cThreads--;
|
||||
break;
|
||||
}
|
||||
pti = pti->ptiSibling;
|
||||
}
|
||||
while (pti);
|
||||
ppti = &((*ppti)->ptiSibling);
|
||||
}
|
||||
|
||||
/* we must have found it */
|
||||
ASSERT(*ppti == ptiCurrent);
|
||||
|
||||
/* Remove it from the list */
|
||||
*ppti = ptiCurrent->ptiSibling;
|
||||
|
||||
DceFreeThreadDCE(ptiCurrent);
|
||||
HOOK_DestroyThreadHooks(Thread);
|
||||
EVENT_DestroyThreadEvents(Thread);
|
||||
@@ -422,6 +418,9 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
|
||||
|
||||
IntSetThreadDesktop(NULL, TRUE);
|
||||
|
||||
/* Decrement thread count */
|
||||
ppiCurrent->cThreads--;
|
||||
|
||||
PsSetThreadWin32Thread(Thread, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user