diff options
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c index ba2d66320fa..19faa1bafae 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -27,6 +27,8 @@ struct thread_state *current_thread = &the_only_thread; | |||
| 27 | 27 | ||
| 28 | struct thread_state *all_threads = &the_only_thread; | 28 | struct thread_state *all_threads = &the_only_thread; |
| 29 | 29 | ||
| 30 | sys_mutex_t global_lock; | ||
| 31 | |||
| 30 | static void | 32 | static void |
| 31 | mark_one_thread (struct thread_state *thread) | 33 | mark_one_thread (struct thread_state *thread) |
| 32 | { | 34 | { |
| @@ -103,3 +105,10 @@ unmark_threads (void) | |||
| 103 | if (iter->m_byte_stack_list) | 105 | if (iter->m_byte_stack_list) |
| 104 | unmark_byte_stack (iter->m_byte_stack_list); | 106 | unmark_byte_stack (iter->m_byte_stack_list); |
| 105 | } | 107 | } |
| 108 | |||
| 109 | void | ||
| 110 | init_threads (void) | ||
| 111 | { | ||
| 112 | sys_mutex_init (&global_lock); | ||
| 113 | sys_mutex_lock (&global_lock); | ||
| 114 | } | ||