瀏覽代碼

Implement function to block current task

DricomDragon 5 年之前
父節點
當前提交
5c9edcb9bb
共有 2 個文件被更改,包括 13 次插入1 次删除
  1. 8 0
      prog/sources/xtr.cpp
  2. 5 1
      prog/sources/xtr.h

+ 8 - 0
prog/sources/xtr.cpp

@@ -229,3 +229,11 @@ static void irq_makeTasksReadyFromCurrentDate (IRQ_MODE_ const uint32_t inCurren
 }
 
 MACRO_REAL_TIME_ISR (irq_makeTasksReadyFromCurrentDate) ;
+
+// Synchronisation
+void kernel_blockRunningTaskInList (KERNEL_MODE_ TaskList & ioWaitingList) {
+	XTR_ASSERT_NON_NULL_POINTER (gRunningTaskControlBlockPtr) ;
+	ioWaitingList.enterTask (MODE_ gRunningTaskControlBlockPtr) ;
+	kernel_makeNoTaskRunning (MODE) ;
+}
+

+ 5 - 1
prog/sources/xtr.h

@@ -1,7 +1,7 @@
 #pragma once
 
-
 #include "software-modes.h"
+#include "task-list-32-tasks.h"
 
 // Task routine type
 
@@ -31,3 +31,7 @@ void kernel_blockOnDeadline (KERNEL_MODE_ const uint32_t inDeadline);
 
 // Task reactivation
 void irq_makeTasksReadyFromCurrentDate (IRQ_MODE);
+
+// Synchronization
+void kernel_blockRunningTaskInList (KERNEL_MODE_ TaskList & ioWaitingList);
+