From 60bea08b22caa8ccae95dbfcdf1bc454acbda795 Mon Sep 17 00:00:00 2001
From: Richard Barry <ribarry@amazon.com>
Date: Sun, 21 Nov 2010 11:35:48 +0000
Subject: [PATCH] Added the traceTAKE_MUTEX_RECURSIVE_FAILED() macro.

---
 Source/include/FreeRTOS.h | 4 ++++
 Source/queue.c            | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/Source/include/FreeRTOS.h b/Source/include/FreeRTOS.h
index a5b8bd8036..5541304df9 100644
--- a/Source/include/FreeRTOS.h
+++ b/Source/include/FreeRTOS.h
@@ -288,6 +288,10 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
 	#define traceTAKE_MUTEX_RECURSIVE( pxMutex )
 #endif
 
+#ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
+	#define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
+#endif
+
 #ifndef traceCREATE_COUNTING_SEMAPHORE
 	#define traceCREATE_COUNTING_SEMAPHORE()
 #endif
diff --git a/Source/queue.c b/Source/queue.c
index 17e37cf45b..e08cc28787 100644
--- a/Source/queue.c
+++ b/Source/queue.c
@@ -415,6 +415,10 @@ size_t xQueueSizeInBytes;
 			{
 				( pxMutex->uxRecursiveCallCount )++;
 			}
+			else
+			{
+				traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex );
+			}
 		}
 
 		return xReturn;