Rev 1595 | Rev 1661 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1595 | Rev 1636 | ||
---|---|---|---|
Line 73... | Line 73... | ||
73 | "Entering", |
73 | "Entering", |
74 | "Exiting", |
74 | "Exiting", |
75 | "Undead" |
75 | "Undead" |
76 | }; |
76 | }; |
77 | 77 | ||
78 | /** Lock protecting threads_head list. For locking rules, see declaration thereof. */ |
78 | /** Lock protecting the threads_btree B+tree. For locking rules, see declaration thereof. */ |
79 | SPINLOCK_INITIALIZE(threads_lock); |
79 | SPINLOCK_INITIALIZE(threads_lock); |
- | 80 | ||
80 | btree_t threads_btree; /**< B+tree of all threads. */ |
81 | /** B+tree of all threads. |
- | 82 | * |
|
- | 83 | * When a thread is found in the threads_btree B+tree, it is guaranteed to exist as long |
|
- | 84 | * as the threads_lock is held. |
|
- | 85 | */ |
|
- | 86 | btree_t threads_btree; |
|
81 | 87 | ||
82 | SPINLOCK_INITIALIZE(tidlock); |
88 | SPINLOCK_INITIALIZE(tidlock); |
83 | __u32 last_tid = 0; |
89 | __u32 last_tid = 0; |
84 | 90 | ||
85 | static slab_cache_t *thread_slab; |
91 | static slab_cache_t *thread_slab; |
Line 550... | Line 556... | ||
550 | /** Check whether thread exists. |
556 | /** Check whether thread exists. |
551 | * |
557 | * |
552 | * Note that threads_lock must be already held and |
558 | * Note that threads_lock must be already held and |
553 | * interrupts must be already disabled. |
559 | * interrupts must be already disabled. |
554 | * |
560 | * |
555 | * When a thread is found in threads_btree, it is guaranteed to exist as long |
- | |
556 | * as the threads_lock is held. |
- | |
557 | * |
- | |
558 | * @param t Pointer to thread. |
561 | * @param t Pointer to thread. |
559 | * |
562 | * |
560 | * @return True if thread t is known to the system, false otherwise. |
563 | * @return True if thread t is known to the system, false otherwise. |
561 | */ |
564 | */ |
562 | bool thread_exists(thread_t *t) |
565 | bool thread_exists(thread_t *t) |