sched: add thread status flags
This commit is contained in:
@@ -17,11 +17,16 @@ typedef enum task_state {
|
||||
} task_state_t;
|
||||
|
||||
typedef enum thread_state {
|
||||
THREAD_READY,
|
||||
THREAD_SLEEPING,
|
||||
THREAD_STOPPED,
|
||||
THREAD_READY = 1,
|
||||
THREAD_SLEEPING = 2,
|
||||
THREAD_STOPPED = 3,
|
||||
} thread_state_t;
|
||||
|
||||
typedef enum thread_flags {
|
||||
THREAD_F_NEED_RESCHED = 0x01u,
|
||||
THREAD_F_NO_PREEMPT = 0x02u,
|
||||
} thread_flags_t;
|
||||
|
||||
typedef enum sched_priority {
|
||||
PRIO_IDLE = 4,
|
||||
PRIO_SUBNORMAL = 6,
|
||||
@@ -45,7 +50,8 @@ typedef struct task {
|
||||
} task_t;
|
||||
|
||||
typedef struct thread {
|
||||
thread_state_t tr_state;
|
||||
thread_state_t tr_state : 8;
|
||||
thread_flags_t tr_flags : 8;
|
||||
task_t *tr_parent;
|
||||
|
||||
unsigned int tr_id;
|
||||
|
||||
Reference in New Issue
Block a user