mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
- Implement KiReleaseProcessLockFromDpcLevel and use it in KeTerminateThread. We were lowering to PASSIVE during thread termination, and then doing a context switch at PASSIVE, which you can guess is pretty bad.
svn path=/trunk/; revision=24068
This commit is contained in:
parent
07dc58982f
commit
5fb31962db
3 changed files with 10 additions and 2 deletions
|
@ -688,6 +688,14 @@ KiReleaseProcessLock(IN PKLOCK_QUEUE_HANDLE Handle)
|
||||||
KeReleaseInStackQueuedSpinLock(Handle);
|
KeReleaseInStackQueuedSpinLock(Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
KiReleaseProcessLockFromDpcLevel(IN PKLOCK_QUEUE_HANDLE Handle)
|
||||||
|
{
|
||||||
|
/* Release the lock */
|
||||||
|
KeReleaseInStackQueuedSpinLockFromDpcLevel(Handle);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// This routine queues a thread that is ready on the PRCB's ready lists.
|
// This routine queues a thread that is ready on the PRCB's ready lists.
|
||||||
// If this thread cannot currently run on this CPU, then the thread is
|
// If this thread cannot currently run on this CPU, then the thread is
|
||||||
|
|
|
@ -1315,7 +1315,7 @@ KeTerminateThread(IN KPRIORITY Increment)
|
||||||
RemoveEntryList(&Thread->ThreadListEntry);
|
RemoveEntryList(&Thread->ThreadListEntry);
|
||||||
|
|
||||||
/* Release the process lock */
|
/* Release the process lock */
|
||||||
KiReleaseProcessLock(&LockHandle);
|
KiReleaseProcessLockFromDpcLevel(&LockHandle);
|
||||||
|
|
||||||
/* Set us as terminated, decrease the Process's stack count */
|
/* Set us as terminated, decrease the Process's stack count */
|
||||||
Thread->State = Terminated;
|
Thread->State = Terminated;
|
||||||
|
|
|
@ -169,9 +169,9 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
||||||
IN PKPRCB Prcb)
|
IN PKPRCB Prcb)
|
||||||
{
|
{
|
||||||
BOOLEAN ApcState;
|
BOOLEAN ApcState;
|
||||||
|
ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL);
|
||||||
|
|
||||||
/* Find a new thread to run */
|
/* Find a new thread to run */
|
||||||
DPRINT("Dispatching Thread as blocked\n");
|
|
||||||
ApcState = KiDispatchThreadNoLock(Waiting);
|
ApcState = KiDispatchThreadNoLock(Waiting);
|
||||||
|
|
||||||
/* Check if we need to deliver APCs */
|
/* Check if we need to deliver APCs */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue