parlib: Add uthread_create()
[akaros.git] / user / parlib / thread0_sched.c
index 1def58c..d973c41 100644 (file)
@@ -24,6 +24,7 @@ static void thread0_thread_runnable(struct uthread *uth);
 static void thread0_thread_has_blocked(struct uthread *uth, uth_sync_t sync,
                                        int flags);
 static void thread0_thread_exited(struct uthread *uth);
+static struct uthread *thread0_thread_create(void *(*func)(void *), void *arg);
 static uth_sync_t thread0_sync_alloc(void);
 static void thread0_sync_free(uth_sync_t);
 static struct uthread *thread0_sync_get_next(uth_sync_t);
@@ -38,6 +39,7 @@ struct schedule_ops thread0_2ls_ops = {
        .thread_paused = thread0_thread_runnable,
        .thread_has_blocked = thread0_thread_has_blocked,
        .thread_exited = thread0_thread_exited,
+       .thread_create = thread0_thread_create,
        .sync_alloc = thread0_sync_alloc,
        .sync_free = thread0_sync_free,
        .sync_get_next = thread0_sync_get_next,
@@ -157,6 +159,11 @@ static void thread0_thread_exited(struct uthread *uth)
        assert(0);
 }
 
+static struct uthread *thread0_thread_create(void *(*func)(void *), void *arg)
+{
+       panic("Thread0 sched asked to create more threads!");
+}
+
 static uth_sync_t thread0_sync_alloc(void)
 {
        return (void*)0xf00baa;