Update xTaskRemoveFromEventList() so when tickless idle is used prvResetNextTaskUnblockTime() only gets called if the scheduler is not locked, as it would get called when the scheduler is unlocked in any case.
diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c
index 75fa463..0c395d7 100644
--- a/FreeRTOS/Source/tasks.c
+++ b/FreeRTOS/Source/tasks.c
@@ -3095,6 +3095,20 @@
 	{

 		( void ) uxListRemove( &( pxUnblockedTCB->xStateListItem ) );

 		prvAddTaskToReadyList( pxUnblockedTCB );

+

+		#if( configUSE_TICKLESS_IDLE != 0 )

+		{

+			/* If a task is blocked on a kernel object then xNextTaskUnblockTime

+			might be set to the blocked task's time out time.  If the task is

+			unblocked for a reason other than a timeout xNextTaskUnblockTime is

+			normally left unchanged, because it is automatically reset to a new

+			value when the tick count equals xNextTaskUnblockTime.  However if

+			tickless idling is used it might be more important to enter sleep mode

+			at the earliest possible time - so reset xNextTaskUnblockTime here to

+			ensure it is updated at the earliest possible time. */

+			prvResetNextTaskUnblockTime();

+		}

+		#endif

 	}

 	else

 	{

@@ -3119,20 +3133,6 @@
 		xReturn = pdFALSE;

 	}

 

-	#if( configUSE_TICKLESS_IDLE != 0 )

-	{

-		/* If a task is blocked on a kernel object then xNextTaskUnblockTime

-		might be set to the blocked task's time out time.  If the task is

-		unblocked for a reason other than a timeout xNextTaskUnblockTime is

-		normally left unchanged, because it is automatically reset to a new

-		value when the tick count equals xNextTaskUnblockTime.  However if

-		tickless idling is used it might be more important to enter sleep mode

-		at the earliest possible time - so reset xNextTaskUnblockTime here to

-		ensure it is updated at the earliest possible time. */

-		prvResetNextTaskUnblockTime();

-	}

-	#endif

-

 	return xReturn;

 }

 /*-----------------------------------------------------------*/