diff options
author | mtm <mtm@FreeBSD.org> | 2003-05-21 03:22:36 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-05-21 03:22:36 +0000 |
commit | 63229f0299c684df704d8675ce60db82dccf7e00 (patch) | |
tree | b8e27a0850e800cbb714afa977b8ab19511f3469 /lib/libthr/thread | |
parent | 03e04e5503bbab0a4cf044eb6ac326f47406119a (diff) | |
download | FreeBSD-src-63229f0299c684df704d8675ce60db82dccf7e00.zip FreeBSD-src-63229f0299c684df704d8675ce60db82dccf7e00.tar.gz |
The thread id was being set *before* zeroing out the thread. Reverse
the order.
Approved by: markm/mentor, re/blanket libthr
Diffstat (limited to 'lib/libthr/thread')
-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); |