I think it is a BUG but I can’t make a bug request. Can anyone help?
xSemaphoreHandle sem ;
void task1(void *pvParam)
{
while(1) {
if (xSemaphoreTake(sem, 100)) {
// BUG! We should be able to go into here, but it never happens
xSemaphoreGive(sem) ;
vTaskDelay(100) ;
}
}
}
void task2(void *pvParam)
{
while (1) {
if (xSemaphoreTake(sem, 50)) {
// Let's do something time consuming with semaphore taken
vTaskDelay(100) ;
xSemaphoreGive(sem) ;
}
}
}
int main( void )
{
prvSetupHardware();
xTaskHandle thDummy ;
sem = xSemaphoreCreateMutex();
xTaskCreate(task1, (signed portCHAR*)"1", configMINIMAL_STACK_SIZE, NULL, 1, &thDummy) ;
xTaskCreate(task2, (signed portCHAR*)"2", configMINIMAL_STACK_SIZE, NULL, 1, &thDummy) ;
vTaskStartScheduler();
}