mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +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);
|
||||
}
|
||||
|
||||
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.
|
||||
// If this thread cannot currently run on this CPU, then the thread is
|
||||
|
|
|
@ -1315,7 +1315,7 @@ KeTerminateThread(IN KPRIORITY Increment)
|
|||
RemoveEntryList(&Thread->ThreadListEntry);
|
||||
|
||||
/* Release the process lock */
|
||||
KiReleaseProcessLock(&LockHandle);
|
||||
KiReleaseProcessLockFromDpcLevel(&LockHandle);
|
||||
|
||||
/* Set us as terminated, decrease the Process's stack count */
|
||||
Thread->State = Terminated;
|
||||
|
|
|
@ -169,9 +169,9 @@ KiSwapThread(IN PKTHREAD CurrentThread,
|
|||
IN PKPRCB Prcb)
|
||||
{
|
||||
BOOLEAN ApcState;
|
||||
ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL);
|
||||
|
||||
/* Find a new thread to run */
|
||||
DPRINT("Dispatching Thread as blocked\n");
|
||||
ApcState = KiDispatchThreadNoLock(Waiting);
|
||||
|
||||
/* Check if we need to deliver APCs */
|
||||
|
|
Loading…
Reference in a new issue