?? exitmonitor.cpp
字號(hào):
#ifndef EXIT_MONITOR#define EXIT_MONITOR#include "moveready.cpp"void ttExitMonitor(char *nameOfMonitor) { MonitorNode* mn; Monitor* mon; TaskNode* tn; mn = (MonitorNode*) rtsys->monitorList->getFirst(); while (mn != NULL) { mon = mn->getMonitor(); if (mon->name != NULL) { if (strcmp(mon->name, nameOfMonitor) == 0) break; } mn = (MonitorNode*) mn->getNext(); } if (mn == NULL) { // Monitor does not exist char buf[200]; sprintf(buf, "ttExitMonitor: Non-existent monitor '%s'!", nameOfMonitor); MEX_ERROR(buf); return; } if (mon->heldBy != rtsys->executing) { MEX_ERROR("ttExitMonitor: Only the task holding the monitor can exit from it!"); } mon = mn->getMonitor(); mon->heldBy = NULL; tn = (TaskNode*) mon->waitingQ->getFirst(); if (tn != NULL) { moveToReadyQ(tn->getTask()); mon->heldBy = tn->getTask(); mon->waitingQ->deleteNode(tn); } rtsys->executing->priority = rtsys->executing->assignedPriority;}#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -