diff options
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 1a0c648..64a1315 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -218,11 +218,12 @@ _thread_init(void) */ PANIC("Cannot allocate memory for initial thread"); } + /* Zero the initial thread structure: */ + memset(pthread, 0, sizeof(struct pthread)); + _thread_initial = pthread; pthread->arch_id = _set_curthread(NULL, pthread); - /* Zero the initial thread structure: */ - memset(pthread, 0, sizeof(struct pthread)); /* Get our thread id. */ thr_self(&pthread->thr_id); |