200 |
struct queue_entry runq; /* Link in run queue. */ |
struct queue_entry runq; /* Link in run queue. */ |
201 |
struct queue_entry waitq; /* Link in wait queue. */ |
struct queue_entry waitq; /* Link in wait queue. */ |
202 |
struct queue_entry ipcq; /* Link in IPC wait queue. */ |
struct queue_entry ipcq; /* Link in IPC wait queue. */ |
203 |
|
struct queue_entry allq; /* Link in thread list. */ |
204 |
spin_lock_t lock; /* Lock for thread. */ |
spin_lock_t lock; /* Lock for thread. */ |
205 |
|
|
206 |
struct queue_entry *runq_list; |
struct queue_entry *runq_list; |
250 |
#define THREAD_STATE_SUSPEND 0x08 /* Thread is suspended. */ |
#define THREAD_STATE_SUSPEND 0x08 /* Thread is suspended. */ |
251 |
#define THREAD_STATE_SWAPPED 0x10 /* Thread is swapped. */ |
#define THREAD_STATE_SWAPPED 0x10 /* Thread is swapped. */ |
252 |
#define THREAD_STATE_INTR 0x20 /* Thread is interrupt thread. */ |
#define THREAD_STATE_INTR 0x20 /* Thread is interrupt thread. */ |
253 |
|
#define THREAD_STATE_ZOMBIE 0x40 /* Thread is dead. */ |
254 |
|
|
255 |
#define THREAD_SCHED_STATE (THREAD_STATE_RUN | \ |
#define THREAD_SCHED_STATE (THREAD_STATE_RUN | \ |
256 |
THREAD_STATE_WAIT | \ |
THREAD_STATE_WAIT | \ |
257 |
THREAD_STATE_SUSPEND | \ |
THREAD_STATE_SUSPEND | \ |
258 |
THREAD_STATE_INTR) |
THREAD_STATE_IDLE | \ |
259 |
|
THREAD_STATE_ZOMBIE) |
260 |
|
|
261 |
int runq_p; |
int runq_p; |
262 |
|
|
308 |
|
|
309 |
bool inherited_priority_p: 1; |
bool inherited_priority_p: 1; |
310 |
|
|
311 |
|
/* True if this thread is currently running. */ |
312 |
|
|
313 |
|
bool running_p: 1; |
314 |
|
|
315 |
/* Activation stack. ACT_STACK_UPPER holds pointer to current |
/* Activation stack. ACT_STACK_UPPER holds pointer to current |
316 |
activation. ACT_STACK_LOWER is the initial activation. */ |
activation. ACT_STACK_LOWER is the initial activation. */ |
317 |
|
|
456 |
|
|
457 |
extern void reaper_continuation (void); |
extern void reaper_continuation (void); |
458 |
|
|
459 |
|
/* Halt running thread THREAD. This will signal to waiting threads that |
460 |
|
the thread have become a zombie. Will put thread on reaper queue. */ |
461 |
|
|
462 |
|
extern kern_return_t thread_zombify_running (struct thread *thread); |
463 |
|
|
464 |
|
/* Terminate THREAD. */ |
465 |
|
|
466 |
|
extern kern_return_t thread_terminate (struct thread *thread); |
467 |
|
|
468 |
#endif /* thread.h */ |
#endif /* thread.h */ |