Rev 623 | Rev 625 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 623 | Rev 624 | ||
|---|---|---|---|
| Line 53... | Line 53... | ||
| 53 | #include <memstr.h> |
53 | #include <memstr.h> |
| 54 | 54 | ||
| 55 | char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */ |
55 | char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */ |
| 56 | 56 | ||
| 57 | SPINLOCK_INITIALIZE(threads_lock); /**< Lock protecting threads_head list. For locking rules, see declaration thereof. */ |
57 | SPINLOCK_INITIALIZE(threads_lock); /**< Lock protecting threads_head list. For locking rules, see declaration thereof. */ |
| 58 | link_t threads_head; /**< List of all threads. */ |
58 | LIST_INITIALIZE(threads_head); /**< List of all threads. */ |
| 59 | 59 | ||
| 60 | SPINLOCK_INITIALIZE(tidlock); |
60 | SPINLOCK_INITIALIZE(tidlock); |
| 61 | __u32 last_tid = 0; |
61 | __u32 last_tid = 0; |
| 62 | 62 | ||
| 63 | 63 | ||
| Line 94... | Line 94... | ||
| 94 | */ |
94 | */ |
| 95 | void thread_init(void) |
95 | void thread_init(void) |
| 96 | { |
96 | { |
| 97 | THREAD = NULL; |
97 | THREAD = NULL; |
| 98 | nrdy = 0; |
98 | nrdy = 0; |
| 99 | list_initialize(&threads_head); |
- | |
| 100 | } |
99 | } |
| 101 | 100 | ||
| 102 | 101 | ||
| 103 | /** Make thread ready |
102 | /** Make thread ready |
| 104 | * |
103 | * |