Browse Source

Implement function to unlock task

DricomDragon 5 years ago
parent
commit
0a0db70ec7
2 changed files with 9 additions and 0 deletions
  1. 8 0
      prog/sources/xtr.cpp
  2. 1 0
      prog/sources/xtr.h

+ 8 - 0
prog/sources/xtr.cpp

@@ -237,3 +237,11 @@ void kernel_blockRunningTaskInList (KERNEL_MODE_ TaskList & ioWaitingList) {
 	kernel_makeNoTaskRunning (MODE) ;
 }
 
+bool irq_makeTaskReadyFromList (IRQ_MODE_ TaskList & ioWaitingList) {
+	TaskControlBlock * taskPtr = ioWaitingList.removeFirstTask (MODE) ;
+	const bool found = taskPtr != nullptr ;
+	if (found) {
+		kernel_makeTaskReady (MODE_ taskPtr) ;
+	}
+	return found ;
+}

+ 1 - 0
prog/sources/xtr.h

@@ -35,3 +35,4 @@ void irq_makeTasksReadyFromCurrentDate (IRQ_MODE);
 // Synchronization
 void kernel_blockRunningTaskInList (KERNEL_MODE_ TaskList & ioWaitingList);
 
+bool irq_makeTaskReadyFromList (IRQ_MODE_ TaskList & ioWaitingList);