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.

2个核传递semaphore不成功

测试notify前想先测试2个核的semaphore传递信号,程序很简单:

在.cfg里加入semaphore,并设为0: Program.global.semHandle = Semaphore.create(0);  

在.c文件的任务里加入如下语句:0核打印,打印完释放semHandle ,1核等semHandle ,semHandle 来的打印:

         coreId = CSL_chipReadReg (CSL_CHIP_DNUM);

switch(coreId)
{
    case 0:
        platform_write("Core %d is working! \n",coreId);
        for(i=0;i<3;i++)
       {
            platform_write("Core %d is working on count %d! \n",coreId,i);
       }
       Semaphore_post(semHandle);
        platform_write("Core %d Mission Complete,and Semaphore is %d \n",coreId,Semaphore_getCount(semHandle));
     break;
case 1:
    Semaphore_pend(semHandle,BIOS_WAIT_FOREVER);
    platform_write("Core 1 is working! \n");
    for(i=0;i<Led_Light_Cnt;i++)
    {
        platform_write("Core 1 is working on count %d! \n",i);
    }

    break;

         default:
               break;
        }

可是运行结果总是0核打印正常,Semaphore_post 之后 Semaphore 也为1了,可是1核就是不打印啊!为啥?