From: Antti Kantee Date: Tue, 21 Apr 2015 13:39:44 +0000 (+0000) Subject: Allocate tls before adding thread onto thread list X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0193299129a81a7090774d2e8496f9b0679445dc;p=people%2Fliuw%2Frumprun.git Allocate tls before adding thread onto thread list Doesn't really matter with the current state of things, but it's nevertheless quite common sense to first init and then publish. --- diff --git a/lib/libbmk_core/sched.c b/lib/libbmk_core/sched.c index c78356f..523803a 100644 --- a/lib/libbmk_core/sched.c +++ b/lib/libbmk_core/sched.c @@ -312,11 +312,11 @@ bmk_sched_create(const char *name, void *cookie, int joinable, thread->bt_wakeup_time = -1; + allocothertls(thread); + flags = bmk_platform_splhigh(); TAILQ_INSERT_TAIL(&threads, thread, bt_entries); bmk_platform_splx(flags); - - allocothertls(thread); set_runnable(thread); return thread;