diff --git a/reactos/ntoskrnl/hal/x86/irql.c b/reactos/ntoskrnl/hal/x86/irql.c index 94266d5391b..3e316f97c09 100644 --- a/reactos/ntoskrnl/hal/x86/irql.c +++ b/reactos/ntoskrnl/hal/x86/irql.c @@ -106,7 +106,12 @@ VOID KeLowerIrql(KIRQL NewIrql) __asm__("cli\n\t"); DPRINT("NewIrql %x CurrentIrql %x\n",NewIrql,CurrentIrql); - assert(NewIrql <= CurrentIrql); + if (NewIrql > CurrentIrql) + { + DbgPrint("NewIrql %x CurrentIrql %x\n",NewIrql,CurrentIrql); + KeDumpStackFrames(0); + for(;;); + } CurrentIrql = NewIrql; HiSwitchIrql(); } diff --git a/reactos/ntoskrnl/ps/thread.c b/reactos/ntoskrnl/ps/thread.c index 199907b84e7..741ed4273c0 100644 --- a/reactos/ntoskrnl/ps/thread.c +++ b/reactos/ntoskrnl/ps/thread.c @@ -74,6 +74,16 @@ static VOID PsInsertIntoThreadList(KPRIORITY Priority, PETHREAD Thread) KeReleaseSpinLock(&ThreadListLock,oldlvl); } +VOID PsBeginThread(PKSTART_ROUTINE StartRoutine, PVOID StartContext) +{ + NTSTATUS Ret; + + KeReleaseSpinLock(&ThreadListLock,PASSIVE_LEVEL); + Ret = StartRoutine(StartContext); + PsTerminateSystemThread(Ret); + for(;;); +} + static PETHREAD PsScanThreadList(KPRIORITY Priority) { PLIST_ENTRY current_entry; @@ -134,7 +144,6 @@ VOID PsDispatchThread(VOID) CurrentThread->Tcb.LastTick = GET_LARGE_INTEGER_LOW_PART(TickCount); CurrentThread->Tcb.ThreadState = THREAD_STATE_RUNNING; KeReleaseSpinLock(&ThreadListLock,irql); - KeLowerIrql(PASSIVE_LEVEL); return; } if (Candidate != NULL) @@ -148,9 +157,8 @@ VOID PsDispatchThread(VOID) CurrentThread = Candidate; - KeReleaseSpinLock(&ThreadListLock,irql); - KeLowerIrql(PASSIVE_LEVEL); HalTaskSwitch(&CurrentThread->Tcb); + KeReleaseSpinLock(&ThreadListLock,irql); return; } }