/* The tests in this function are very similar, the slight variations\r
are for code coverage purposes. */\r
\r
- /* Take the mutex. It should be available now. */\r
+ /* Take the mutex. It should be available now. Check before and after\r
+ taking that the holder is reported correctly. */\r
+ if( xSemaphoreGetMutexHolder( xMutex ) != NULL )\r
+ {\r
+ xErrorDetected = pdTRUE;\r
+ }\r
if( xSemaphoreTake( xMutex, intsemNO_BLOCK ) != pdPASS )\r
{\r
xErrorDetected = pdTRUE;\r
}\r
+ if( xSemaphoreGetMutexHolder( xMutex ) != xTaskGetCurrentTaskHandle() )\r
+ {\r
+ xErrorDetected = pdTRUE;\r
+ }\r
\r
/* This task's priority should be as per that assigned when the task was\r
created. */\r
vTaskDelay( genqSHORT_BLOCK );\r
}\r
\r
- /* Give the semaphore back ready for the next test. */\r
+ /* Give the semaphore back ready for the next test. Check the mutex\r
+ holder before and after using the "FromISR" version for code coverage. */\r
+ if( xSemaphoreGetMutexHolderFromISR( xMutex ) != xTaskGetCurrentTaskHandle() )\r
+ {\r
+ xErrorDetected = pdTRUE;\r
+ }\r
xSemaphoreGive( xMutex );\r
+ if( xSemaphoreGetMutexHolderFromISR( xMutex ) != NULL )\r
+ {\r
+ xErrorDetected = pdTRUE;\r
+ }\r
\r
configASSERT( xErrorDetected == pdFALSE );\r
\r