summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-05-21 03:22:36 +0000
committermtm <mtm@FreeBSD.org>2003-05-21 03:22:36 +0000
commit63229f0299c684df704d8675ce60db82dccf7e00 (patch)
treeb8e27a0850e800cbb714afa977b8ab19511f3469 /lib/libthr
parent03e04e5503bbab0a4cf044eb6ac326f47406119a (diff)
downloadFreeBSD-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')
-rw-r--r--lib/libthr/thread/thr_init.c5
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);
OpenPOWER on IntegriCloud