* 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
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)
* 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
*/
if (old_level < DISPATCH_LEVEL && irq == 0)
{
- PsDispatchThread(THREAD_STATE_RUNNABLE);
+ PsDispatchThread(THREAD_STATE_READY);
}
}
-/* $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
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,
KeBugCheck(0);
}
InsertTailList(&PriorityListHead[Priority], &Thread->Tcb.QueueListEntry);
- PiNrRunnableThreads++;
+ PiNrReadyThreads++;
}
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)
{
{
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);
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);
}
return;
}
if (Candidate != NULL)
- {
+ {
PETHREAD OldThread;
DPRINT("Scheduling %x(%d)\n",Candidate, CurrentPriority);
return;
}
}
- CPRINT("CRITICAL: No threads are runnable\n");
+ CPRINT("CRITICAL: No threads are ready\n");
KeBugCheck(0);
}
if (!DoneInitYet)
{
return;
- }
+ }
- KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
+ KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
/*
* Save wait IRQL
*/
{
Thread->Tcb.WaitStatus = *WaitStatus;
}
- Thread->Tcb.State = THREAD_STATE_RUNNABLE;
+ Thread->Tcb.State = THREAD_STATE_READY;
PsInsertIntoThreadList(Thread->Tcb.Priority, Thread);
KeReleaseSpinLock(&PiThreadListLock, oldIrql);
}
}
Thread->Tcb.WaitBlockList = NULL;
KeReleaseDispatcherDatabaseLockAtDpcLevel(FALSE);
- PsDispatchThreadNoLock (THREAD_STATE_RUNNABLE);
+ PsDispatchThreadNoLock (THREAD_STATE_READY);
if (Status != NULL)
{
*Status = STATUS_KERNEL_APC;
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,
NTSTATUS STDCALL
NtYieldExecution(VOID)
{
- PsDispatchThread(THREAD_STATE_RUNNABLE);
+ PsDispatchThread(THREAD_STATE_READY);
return(STATUS_SUCCESS);
}