Converted thread states to BeOS equivalents (excluding THREAD_STATE_FREE_ON_RESCHED, which will probably go away once the slab allocator is in). Converted priorities to BeOS equivalents; we now have 60 priority queues to map the 120 BeOS priority levels (which have a granularity of 2, thanks Axel) plus the idle queue. Fixed PS.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@573 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
lillo
2002-08-04 20:10:06 +00:00
parent 752c497115
commit 91363a4278
12 changed files with 145 additions and 109 deletions
+9
View File
@@ -254,6 +254,7 @@ typedef enum {
B_THREAD_WAITING
} thread_state;
/*
#define THREAD_IDLE_PRIORITY 0
#define THREAD_NUM_PRIORITY_LEVELS 64
@@ -272,6 +273,10 @@ typedef enum {
#define THREAD_RT_LOW_PRIORITY THREAD_MIN_RT_PRIORITY
#define THREAD_RT_HIGH_PRIORITY THREAD_MAX_RT_PRIORITY
*/
#define B_IDLE_PRIORITY 0
#define B_LOWEST_ACTIVE_PRIORITY 1
#define B_LOW_PRIORITY 5
#define B_NORMAL_PRIORITY 10
@@ -281,6 +286,10 @@ typedef enum {
#define B_URGENT_PRIORITY 110
#define B_REAL_TIME_PRIORITY 120
#define B_FIRST_REAL_TIME_PRIORITY B_REAL_TIME_DISPLAY_PRIORITY
#define B_MIN_PRIORITY B_IDLE_PRIORITY
#define B_MAX_PRIORITY B_REAL_TIME_PRIORITY
/** information on a thread
* @note the thread can be in any state
*/
+6 -26
View File
@@ -22,26 +22,6 @@ extern "C" {
#include <smp.h>
#include <arch/thread_struct.h>
#define THREAD_IDLE_PRIORITY 0
#define THREAD_NUM_PRIORITY_LEVELS 64
#define THREAD_MIN_PRIORITY (THREAD_IDLE_PRIORITY + 1)
#define THREAD_MAX_PRIORITY (THREAD_NUM_PRIORITY_LEVELS - THREAD_NUM_RT_PRIORITY_LEVELS - 1)
#define THREAD_NUM_RT_PRIORITY_LEVELS 16
#define THREAD_MIN_RT_PRIORITY (THREAD_MAX_PRIORITY + 1)
#define THREAD_MAX_RT_PRIORITY (THREAD_NUM_PRIORITY_LEVELS - 1)
#define THREAD_LOWEST_PRIORITY THREAD_MIN_PRIORITY
#define THREAD_LOW_PRIORITY 12
#define THREAD_MEDIUM_PRIORITY 24
#define THREAD_HIGH_PRIORITY 36
#define THREAD_HIGHEST_PRIORITY THREAD_MAX_PRIORITY
#define THREAD_RT_LOW_PRIORITY THREAD_MIN_RT_PRIORITY
#define THREAD_RT_HIGH_PRIORITY THREAD_MAX_RT_PRIORITY
extern spinlock_t thread_spinlock;
#define GRAB_THREAD_LOCK() acquire_spinlock(&thread_spinlock)
#define RELEASE_THREAD_LOCK() release_spinlock(&thread_spinlock)
@@ -55,12 +35,12 @@ extern spinlock_t team_spinlock;
#define RELEASE_TEAM_LOCK() release_spinlock(&team_spinlock)
enum {
THREAD_STATE_READY = 0, // ready to run
THREAD_STATE_RUNNING, // running right now somewhere
THREAD_STATE_WAITING, // blocked on something
THREAD_STATE_SUSPENDED, // suspended, not in queue
THREAD_STATE_FREE_ON_RESCHED, // free the thread structure upon reschedule
THREAD_STATE_BIRTH // thread is being created
// THREAD_STATE_READY = 0, // ready to run
// THREAD_STATE_RUNNING, // running right now somewhere
// THREAD_STATE_WAITING, // blocked on something
// THREAD_STATE_SUSPENDED, // suspended, not in queue
THREAD_STATE_FREE_ON_RESCHED=7, // free the thread structure upon reschedule
// THREAD_STATE_BIRTH // thread is being created
};
enum {