Rev 2903 | Rev 3018 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2903 | Rev 2925 | ||
---|---|---|---|
Line 85... | Line 85... | ||
85 | * |
85 | * |
86 | * For locking rules, see declaration thereof. |
86 | * For locking rules, see declaration thereof. |
87 | */ |
87 | */ |
88 | SPINLOCK_INITIALIZE(threads_lock); |
88 | SPINLOCK_INITIALIZE(threads_lock); |
89 | 89 | ||
90 | /** ALV tree of all threads. |
90 | /** AVL tree of all threads. |
91 | * |
91 | * |
92 | * When a thread is found in the threads_tree AVL tree, it is guaranteed to |
92 | * When a thread is found in the threads_tree AVL tree, it is guaranteed to |
93 | * exist as long as the threads_lock is held. |
93 | * exist as long as the threads_lock is held. |
94 | */ |
94 | */ |
95 | avltree_t threads_tree; |
95 | avltree_t threads_tree; |
Line 265... | Line 265... | ||
265 | 265 | ||
266 | /** Create new thread |
266 | /** Create new thread |
267 | * |
267 | * |
268 | * Create a new thread. |
268 | * Create a new thread. |
269 | * |
269 | * |
270 | * @param func Thread's implementing function. |
270 | * @param func Thread's implementing function. |
271 | * @param arg Thread's implementing function argument. |
271 | * @param arg Thread's implementing function argument. |
272 | * @param task Task to which the thread belongs. |
272 | * @param task Task to which the thread belongs. The caller must |
- | 273 | * guarantee that the task won't cease to exist during the |
|
- | 274 | * call. The task's lock may not be held. |
|
273 | * @param flags Thread flags. |
275 | * @param flags Thread flags. |
274 | * @param name Symbolic name. |
276 | * @param name Symbolic name. |
275 | * @param uncounted Thread's accounting doesn't affect accumulated task |
277 | * @param uncounted Thread's accounting doesn't affect accumulated task |
276 | * accounting. |
278 | * accounting. |
277 | * |
279 | * |
278 | * @return New thread's structure on success, NULL on failure. |
280 | * @return New thread's structure on success, NULL on failure. |
279 | * |
281 | * |
280 | */ |
282 | */ |
281 | thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, |
283 | thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, |
282 | int flags, char *name, bool uncounted) |
284 | int flags, char *name, bool uncounted) |
283 | { |
285 | { |