BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / 6063f6693644654ed3fe8ed5c6ca6be311696132 / task / task.c

// Related

Nucleus

Barry Fixed scheduler double-schedule bug 6063f66 (3 years, 2 months ago)
diff --git a/task/task.c b/task/task.c
index a4d137d..597df30 100644
--- a/task/task.c
+++ b/task/task.c
@@ -29,6 +29,7 @@ ObjectType taskType = {
 Task *currentTask[MAX_CPUS];
 pid_t nextTid = 1;
 extern char stackTop[];
+extern ObjectList *readyQueue[];
 
 /* Create a new Task */
 static void
@@ -131,6 +132,16 @@ block_task(enum State reason, ObjectList *list)
 	schedule();
 }
 
+/* Unblock a task */
+void
+unblock_task(Task *task)
+{
+	lock(task);
+	task->state = READY;
+	add(readyQueue[task->priority], task);
+	unlock(task);
+}
+
 /* Find a task by ID */
 Task *
 find_task(pid_t tid)