]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/l4util/lib/src/thread.c
update
[l4.git] / l4 / pkg / l4util / lib / src / thread.c
index c498df0dbe453c1f2f87b304da781ebddcbe3995..d381079e2edf37168a5351685c4b122fc3968204 100644 (file)
@@ -28,10 +28,6 @@ l4util_create_thread(l4_cap_idx_t id, l4_utcb_t *thread_utcb,
   if (l4_error(res))
     return l4_error(res);
 
-  res = l4_scheduler_run_thread(scheduler, id, &scp);
-  if (l4_error(res))
-    return l4_error(res);
-
   l4_thread_control_start();
   l4_thread_control_pager(pager);
   l4_thread_control_bind(thread_utcb, task);
@@ -43,5 +39,12 @@ l4util_create_thread(l4_cap_idx_t id, l4_utcb_t *thread_utcb,
   if (l4_error(res))
     return l4_error(res);
 
+  if (!l4_is_invalid_cap(scheduler))
+    {
+      res = l4_scheduler_run_thread(scheduler, id, &scp);
+      if (l4_error(res))
+        return l4_error(res);
+    }
+
   return 0;
 }