mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:KE] Acquire PRCB lock before marking thread ready for execution in dispatch interrupt routine (#6387)
Fixed in x86 and ARM (this was already done in x64).
This is needed because thread preparation routine KxQueueReadyThread()
releases PRCB lock, but does not acquire it, so that the locking must
always be done outside the function, same as in all its other usage cases.
This fixes an assert from release PRCB routine, when booting x86 ReactOS
in SMP mode, because it attempts to release the lock when it is not
actually acquired.
Addendum to commit a011d19ed
.
+ Add an assert in KxQueueReadyThread() to ensure the PRCB lock is actually acquired.
This commit is contained in:
parent
f72d6dd4c5
commit
ab528ac6ae
3 changed files with 7 additions and 0 deletions
|
@ -1359,6 +1359,7 @@ KxQueueReadyThread(IN PKTHREAD Thread,
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
ASSERT(Prcb == KeGetCurrentPrcb());
|
ASSERT(Prcb == KeGetCurrentPrcb());
|
||||||
|
ASSERT(Prcb->PrcbLock != 0);
|
||||||
ASSERT(Thread->State == Running);
|
ASSERT(Thread->State == Running);
|
||||||
ASSERT(Thread->NextProcessor == Prcb->Number);
|
ASSERT(Thread->NextProcessor == Prcb->Number);
|
||||||
|
|
||||||
|
|
|
@ -334,6 +334,9 @@ KiDispatchInterrupt(VOID)
|
||||||
}
|
}
|
||||||
else if (Prcb->NextThread)
|
else if (Prcb->NextThread)
|
||||||
{
|
{
|
||||||
|
/* Acquire the PRCB lock */
|
||||||
|
KiAcquirePrcbLock(Prcb);
|
||||||
|
|
||||||
/* Capture current thread data */
|
/* Capture current thread data */
|
||||||
OldThread = Prcb->CurrentThread;
|
OldThread = Prcb->CurrentThread;
|
||||||
NewThread = Prcb->NextThread;
|
NewThread = Prcb->NextThread;
|
||||||
|
|
|
@ -495,6 +495,9 @@ KiDispatchInterrupt(VOID)
|
||||||
}
|
}
|
||||||
else if (Prcb->NextThread)
|
else if (Prcb->NextThread)
|
||||||
{
|
{
|
||||||
|
/* Acquire the PRCB lock */
|
||||||
|
KiAcquirePrcbLock(Prcb);
|
||||||
|
|
||||||
/* Capture current thread data */
|
/* Capture current thread data */
|
||||||
OldThread = Prcb->CurrentThread;
|
OldThread = Prcb->CurrentThread;
|
||||||
NewThread = Prcb->NextThread;
|
NewThread = Prcb->NextThread;
|
||||||
|
|
Loading…
Reference in a new issue