Renamed some thread states.

svn path=/trunk/; revision=3205
This commit is contained in:
Eric Kohl 2002-07-10 15:15:00 +00:00
parent 2ecad3b855
commit cae7cd6a6c
5 changed files with 24 additions and 24 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: ps.h,v 1.35 2002/07/04 19:56:35 dwelch Exp $
/* $Id: ps.h,v 1.36 2002/07/10 15:11:46 ekohl Exp $
*
* FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Process manager definitions
@ -515,8 +515,8 @@ NTSTATUS PsSuspendThread(PETHREAD Thread, PULONG PreviousCount);
NTSTATUS PsResumeThread(PETHREAD Thread, PULONG PreviousCount);
#define THREAD_STATE_INVALID (0)
#define THREAD_STATE_RUNNABLE (1)
#define THREAD_STATE_INITIALIZED (0)
#define THREAD_STATE_READY (1)
#define THREAD_STATE_RUNNING (2)
#define THREAD_STATE_SUSPENDED (3)
#define THREAD_STATE_FROZEN (4)

View file

@ -157,8 +157,8 @@ static CPU_REGISTER GspRegisters[NUMREGS] =
static PCHAR GspThreadStates[THREAD_STATE_MAX] =
{
"Invalid", /* THREAD_STATE_INVALID */
"Runnable", /* THREAD_STATE_RUNNABLE */
"Initialized", /* THREAD_STATE_INITIALIZED */
"Ready", /* THREAD_STATE_READY */
"Running", /* THREAD_STATE_RUNNING */
"Suspended", /* THREAD_STATE_SUSPENDED */
"Frozen", /* THREAD_STATE_FROZEN */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: irq.c,v 1.20 2002/05/06 22:25:50 dwelch Exp $
/* $Id: irq.c,v 1.21 2002/07/10 15:12:33 ekohl Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/i386/irq.c
@ -468,7 +468,7 @@ KiInterruptDispatch (ULONG irq, PKIRQ_TRAPFRAME Trapframe)
*/
if (old_level < DISPATCH_LEVEL && irq == 0)
{
PsDispatchThread(THREAD_STATE_RUNNABLE);
PsDispatchThread(THREAD_STATE_READY);
}
}

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: kthread.c,v 1.27 2002/06/10 21:34:36 hbirr Exp $
/* $Id: kthread.c,v 1.28 2002/07/10 15:13:33 ekohl Exp $
*
* FILE: ntoskrnl/ke/kthread.c
* PURPOSE: Microkernel thread support
@ -152,7 +152,7 @@ KeInitializeThread(PKPROCESS Process, PKTHREAD Thread, BOOLEAN First)
Thread->Teb = NULL;
Thread->TlsArray = NULL;
Thread->DebugActive = 0;
Thread->State = THREAD_STATE_BLOCKED;
Thread->State = THREAD_STATE_INITIALIZED;
Thread->Alerted[0] = 0;
Thread->Alerted[1] = 0;
Thread->Iopl = 0;

View file

@ -1,4 +1,4 @@
/* $Id: thread.c,v 1.98 2002/06/18 21:51:10 dwelch Exp $
/* $Id: thread.c,v 1.99 2002/07/10 15:15:00 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -48,7 +48,7 @@ static LIST_ENTRY PriorityListHead[MAXIMUM_PRIORITY];
static BOOLEAN DoneInitYet = FALSE;
static PETHREAD IdleThreads[MAXIMUM_PROCESSORS];
ULONG PiNrThreads = 0;
ULONG PiNrRunnableThreads = 0;
ULONG PiNrReadyThreads = 0;
static GENERIC_MAPPING PiThreadMapping = {THREAD_READ,
THREAD_WRITE,
@ -82,7 +82,7 @@ PsInsertIntoThreadList(KPRIORITY Priority, PETHREAD Thread)
KeBugCheck(0);
}
InsertTailList(&PriorityListHead[Priority], &Thread->Tcb.QueueListEntry);
PiNrRunnableThreads++;
PiNrReadyThreads++;
}
VOID PsDumpThreads(BOOLEAN IncludeSystem)
@ -115,7 +115,7 @@ VOID PsDumpThreads(BOOLEAN IncludeSystem)
current->ThreadsProcess->UniqueProcessId,
current->Cid.UniqueThread,
current->ThreadsProcess->ImageFileName);
if (current->Tcb.State == THREAD_STATE_RUNNABLE ||
if (current->Tcb.State == THREAD_STATE_READY ||
current->Tcb.State == THREAD_STATE_SUSPENDED ||
current->Tcb.State == THREAD_STATE_BLOCKED)
{
@ -167,7 +167,7 @@ static PETHREAD PsScanThreadList (KPRIORITY Priority, ULONG Affinity)
{
current = CONTAINING_RECORD(current_entry, ETHREAD,
Tcb.QueueListEntry);
assert(current->Tcb.State == THREAD_STATE_RUNNABLE);
assert(current->Tcb.State == THREAD_STATE_READY);
DPRINT("current->Tcb.UserAffinity %x Affinity %x PID %d %d\n",
current->Tcb.UserAffinity, Affinity, current->Cid.UniqueThread,
Priority);
@ -195,9 +195,9 @@ VOID PsDispatchThreadNoLock (ULONG NewThreadStatus)
CurrentThread->Cid.UniqueThread);
CurrentThread->Tcb.State = NewThreadStatus;
if (CurrentThread->Tcb.State == THREAD_STATE_RUNNABLE)
if (CurrentThread->Tcb.State == THREAD_STATE_READY)
{
PiNrRunnableThreads++;
PiNrReadyThreads++;
PsInsertIntoThreadList(CurrentThread->Tcb.Priority,
CurrentThread);
}
@ -214,7 +214,7 @@ VOID PsDispatchThreadNoLock (ULONG NewThreadStatus)
return;
}
if (Candidate != NULL)
{
{
PETHREAD OldThread;
DPRINT("Scheduling %x(%d)\n",Candidate, CurrentPriority);
@ -230,7 +230,7 @@ VOID PsDispatchThreadNoLock (ULONG NewThreadStatus)
return;
}
}
CPRINT("CRITICAL: No threads are runnable\n");
CPRINT("CRITICAL: No threads are ready\n");
KeBugCheck(0);
}
@ -242,9 +242,9 @@ PsDispatchThread(ULONG NewThreadStatus)
if (!DoneInitYet)
{
return;
}
}
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
/*
* Save wait IRQL
*/
@ -263,7 +263,7 @@ PsUnblockThread(PETHREAD Thread, PNTSTATUS WaitStatus)
{
Thread->Tcb.WaitStatus = *WaitStatus;
}
Thread->Tcb.State = THREAD_STATE_RUNNABLE;
Thread->Tcb.State = THREAD_STATE_READY;
PsInsertIntoThreadList(Thread->Tcb.Priority, Thread);
KeReleaseSpinLock(&PiThreadListLock, oldIrql);
}
@ -293,7 +293,7 @@ PsBlockThread(PNTSTATUS Status, UCHAR Alertable, ULONG WaitMode,
}
Thread->Tcb.WaitBlockList = NULL;
KeReleaseDispatcherDatabaseLockAtDpcLevel(FALSE);
PsDispatchThreadNoLock (THREAD_STATE_RUNNABLE);
PsDispatchThreadNoLock (THREAD_STATE_READY);
if (Status != NULL)
{
*Status = STATUS_KERNEL_APC;
@ -465,7 +465,7 @@ KeSetPriorityThread (PKTHREAD Thread, KPRIORITY Priority)
Thread->Priority = (CHAR)Priority;
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
if (Thread->State == THREAD_STATE_RUNNABLE)
if (Thread->State == THREAD_STATE_READY)
{
RemoveEntryList(&Thread->QueueListEntry);
PsInsertIntoThreadList(Thread->BasePriority,
@ -542,7 +542,7 @@ NtContinue(IN PCONTEXT Context,
NTSTATUS STDCALL
NtYieldExecution(VOID)
{
PsDispatchThread(THREAD_STATE_RUNNABLE);
PsDispatchThread(THREAD_STATE_READY);
return(STATUS_SUCCESS);
}