Taking a mutex multiple times

alan_rouse wrote on Wednesday, September 25, 2013:

This issue was raised in 2008 (http://www.freertos.org/FreeRTOS_Support_Forum_Archive/September_2008/freertos_taking_a_mutex_multiple_times_2258181.html) but I don’t think the answer was clear.

I have a similar requirement in that one task could call a function that needs exclusive use of a resource several times before finishing with it. I propose using xSemaphoreTake() within the function, with the last call invoking xSemaphoreGive() to release the mutex.

Will the task that currently holds the mutex be blocked if it calls xSemaphoreTake() again?