mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user