- if( ulPendingInterrupts != 0 )\r
- {\r
- /* Going to wait for an event - make sure the event is not already\r
- signaled. */\r
- ResetEvent( pxThreadState->pvYieldEvent );\r
- lWaitForYield = pdTRUE;\r
- }\r
+ /* The interrupt won't actually executed until\r
+ pvInterruptEventMutex is released as it waits on both\r
+ pvInterruptEventMutex and pvInterruptEvent.\r
+ pvInterruptEvent is only set when the simulated\r
+ interrupt is pendeded if the interrupt is pended\r
+ from outside a critical section - hence it is set\r
+ here. */\r
+ SetEvent( pvInterruptEvent );\r
+ /* The calling task is going to wait for an event to ensure the\r
+ interrupt that is pending executes immediately after the\r
+ critical section is exited - so make sure the event is not\r
+ already signaled. */\r
+ ResetEvent( pxThreadState->pvYieldEvent );\r
+ lWaitForYield = pdTRUE;\r