]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/queue.c
Changes to core code and port layer:
[freertos] / FreeRTOS / Source / queue.c
index 9884658eb9cb79904d8a379f3b0f1534b767244a..e8ae0d307d2f26ccc6d77efe4c37057632218ca2 100644 (file)
@@ -567,6 +567,32 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, const UBaseT
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
+#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )\r
+\r
+       void* xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore )\r
+       {\r
+       void *pxReturn;\r
+\r
+               configASSERT( xSemaphore );\r
+\r
+               /* Mutexes cannot be used in interrupt service routines, so the mutex\r
+               holder should not change in an ISR, and therefore a critical section is\r
+               not required here. */\r
+               if( ( ( Queue_t * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX )\r
+               {\r
+                       pxReturn = ( void * ) ( ( Queue_t * ) xSemaphore )->pxMutexHolder;\r
+               }\r
+               else\r
+               {\r
+                       pxReturn = NULL;\r
+               }\r
+\r
+               return pxReturn;\r
+       } /*lint !e818 xSemaphore cannot be a pointer to const because it is a typedef. */\r
+\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
 #if ( configUSE_RECURSIVE_MUTEXES == 1 )\r
 \r
        BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex )\r