priority.c
来自「嵌入式系统基础课件」· C语言 代码 · 共 34 行
C
34 行
#include "priority.h"
extern void ChangePriority(int thread, int priority) ;
/* ---------------------------------------------------- */
/* Use the #defines in the above header file and the */
/* externally-defined functions to modify one or more */
/* of the four functions defined in this file in order */
/* to implement: */
/* */
/* (1) The Priority Ceiling Protocol, and */
/* (2) The Priority Inheritance Protocol. */
/* ---------------------------------------------------- */
void LoPriThreadPend(void)
{
SemaphorePend(TSK_LOW) ;
}
void LoPriThreadPost(void)
{
SemaphorePost(TSK_LOW) ;
}
void HiPriThreadPend(void)
{
SemaphorePend(TSK_HI) ;
}
void HiPriThreadPost(void)
{
SemaphorePost(TSK_HI) ;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?