]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Allocate tls before adding thread onto thread list
authorAntti Kantee <pooka@iki.fi>
Tue, 21 Apr 2015 13:39:44 +0000 (13:39 +0000)
committerAntti Kantee <pooka@iki.fi>
Tue, 21 Apr 2015 13:39:44 +0000 (13:39 +0000)
Doesn't really matter with the current state of things, but it's
nevertheless quite common sense to first init and then publish.

lib/libbmk_core/sched.c

index c78356fac3d8b46fcc1090ad106572726c00aa36..523803a1e1c0171821ed38f60a9a6baf9b581cd6 100644 (file)
@@ -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;