* exactly five times.\r
*\r
* @param xMutex A handle to the mutex being obtained. This is the\r
- * handle returned by xSemaphoreCreateMutex();\r
+ * handle returned by xSemaphoreCreateRecursiveMutex();\r
*\r
* @param xBlockTime The time in ticks to wait for the semaphore to become\r
* available. The macro portTICK_RATE_MS can be used to convert this to a\r
// code these would not be just sequential calls as this would make\r
// no sense. Instead the calls are likely to be buried inside\r
// a more complex call structure.\r
- xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 );\r
- xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 );\r
+ xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );\r
+ xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );\r
\r
// The mutex has now been 'taken' three times, so will not be \r
// available to another task until it has also been given back\r
// three times. Again it is unlikely that real code would have\r
// these calls sequentially, but instead buried in a more complex\r
// call structure. This is just for illustrative purposes.\r
- xSemaphoreGiveRecursive( xSemaphore );\r
- xSemaphoreGiveRecursive( xSemaphore );\r
- xSemaphoreGiveRecursive( xSemaphore );\r
+ xSemaphoreGiveRecursive( xMutex );\r
+ xSemaphoreGiveRecursive( xMutex );\r
+ xSemaphoreGiveRecursive( xMutex );\r
\r
// Now the mutex can be taken by other tasks.\r
}\r
\r
/**\r
* semphr. h\r
- * <pre>xSemaphoreGiveRecursive( xSemaphoreHandle xSemaphore )</pre>\r
+ * <pre>xSemaphoreGiveRecursive( xSemaphoreHandle xMutex )</pre>\r
*\r
* <i>Macro</i> to recursively release, or 'give', a mutex type semaphore.\r
* The mutex must have previously been created using a call to \r
{\r
// See if we can obtain the mutex. If the mutex is not available\r
// wait 10 ticks to see if it becomes free. \r
- if( xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 ) == pdTRUE )\r
+ if( xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 ) == pdTRUE )\r
{\r
// We were able to obtain the mutex and can now access the\r
// shared resource.\r
// code these would not be just sequential calls as this would make\r
// no sense. Instead the calls are likely to be buried inside\r
// a more complex call structure.\r
- xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 );\r
- xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 );\r
+ xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );\r
+ xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );\r
\r
// The mutex has now been 'taken' three times, so will not be \r
// available to another task until it has also been given back\r
// these calls sequentially, it would be more likely that the calls\r
// to xSemaphoreGiveRecursive() would be called as a call stack\r
// unwound. This is just for demonstrative purposes.\r
- xSemaphoreGiveRecursive( xSemaphore );\r
- xSemaphoreGiveRecursive( xSemaphore );\r
- xSemaphoreGiveRecursive( xSemaphore );\r
+ xSemaphoreGiveRecursive( xMutex );\r
+ xSemaphoreGiveRecursive( xMutex );\r
+ xSemaphoreGiveRecursive( xMutex );\r
\r
// Now the mutex can be taken by other tasks.\r
}\r