Rev 1595 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1595 | Rev 1661 | ||
|---|---|---|---|
| Line 44... | Line 44... | ||
| 44 | #include <mm/slab.h> |
44 | #include <mm/slab.h> |
| 45 | #include <proc/uarg.h> |
45 | #include <proc/uarg.h> |
| 46 | 46 | ||
| 47 | #define THREAD_STACK_SIZE STACK_SIZE |
47 | #define THREAD_STACK_SIZE STACK_SIZE |
| 48 | 48 | ||
| - | 49 | /**< Thread states. */ |
|
| 49 | enum state { |
50 | enum state { |
| 50 | Invalid, /**< It is an error, if thread is found in this state. */ |
51 | Invalid, /**< It is an error, if thread is found in this state. */ |
| 51 | Running, /**< State of a thread that is currently executing on some CPU. */ |
52 | Running, /**< State of a thread that is currently executing on some CPU. */ |
| 52 | Sleeping, /**< Thread in this state is waiting for an event. */ |
53 | Sleeping, /**< Thread in this state is waiting for an event. */ |
| 53 | Ready, /**< State of threads in a run queue. */ |
54 | Ready, /**< State of threads in a run queue. */ |
| Line 56... | Line 57... | ||
| 56 | Undead /**< Threads that were not detached but exited are in the Undead state. */ |
57 | Undead /**< Threads that were not detached but exited are in the Undead state. */ |
| 57 | }; |
58 | }; |
| 58 | 59 | ||
| 59 | extern char *thread_states[]; |
60 | extern char *thread_states[]; |
| 60 | 61 | ||
| - | 62 | /**< Join types. */ |
|
| - | 63 | typedef enum { |
|
| - | 64 | None, |
|
| - | 65 | TaskClnp, /**< The thread will be joined by ktaskclnp thread. */ |
|
| - | 66 | TaskGC /**< The thread will be joined by ktaskgc thread. */ |
|
| - | 67 | } thread_join_type_t; |
|
| - | 68 | ||
| 61 | #define X_WIRED (1<<0) |
69 | #define X_WIRED (1<<0) |
| 62 | #define X_STOLEN (1<<1) |
70 | #define X_STOLEN (1<<1) |
| 63 | 71 | ||
| 64 | #define THREAD_NAME_BUFLEN 20 |
72 | #define THREAD_NAME_BUFLEN 20 |
| 65 | 73 | ||
| Line 101... | Line 109... | ||
| 101 | * If true, the thread will not go to sleep at all and will |
109 | * If true, the thread will not go to sleep at all and will |
| 102 | * call thread_exit() before returning to userspace. |
110 | * call thread_exit() before returning to userspace. |
| 103 | */ |
111 | */ |
| 104 | bool interrupted; |
112 | bool interrupted; |
| 105 | 113 | ||
| - | 114 | thread_join_type_t join_type; /**< Who joinins the thread. */ |
|
| 106 | bool detached; /**< If true, thread_join_timeout() cannot be used on this thread. */ |
115 | bool detached; /**< If true, thread_join_timeout() cannot be used on this thread. */ |
| 107 | waitq_t join_wq; /**< Waitq for thread_join_timeout(). */ |
116 | waitq_t join_wq; /**< Waitq for thread_join_timeout(). */ |
| 108 | 117 | ||
| 109 | fpu_context_t *saved_fpu_context; |
118 | fpu_context_t *saved_fpu_context; |
| 110 | int fpu_context_exists; |
119 | int fpu_context_exists; |