This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

通过信号量来调度任务的问题



各位好,这里有个问题想请教下大家。

是这样的,在工程中创建了3个任务,任务的执行顺序是通过信号量来控制的。

大致框架如下:

void tskFxn0()
{
    for(;;)
    {
         ...
         Semaphore_post(sem_fxn1);
         ...
    }
}

void tskFxn1()
{
    for(;;)
    {
         ...
         Semaphore_pend(sem_fxn1, BIOS_WAIT_FOREVER);
         ...
         Semaphore_post(sem_fxn2);
         ...
    }
}

void tskFxn2()
{
    for(;;)
    {
         ...
         Semaphore_pend(sem_fxn2, BIOS_WAIT_FOREVER);
         ...
    }
}

其中tskFxn0优先级最低,其他两个任务优先级一样。

问题就是:程序会一直在tskFxn0中,一直post信号,其他任务不能得到信号