mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-31 07:28:37 -04:00
Introduce the portSOFTWARE_BARRIER macro which thus far is only used by the Win32 demo to hold execution up in case a simulated interrupt is executing simultaneously. That should never happen as all threads should execute on the same core, but we have had numerous reports that this and other Win32 port changes we have made fixed these issues - although we have not been able to replicate them ourselves.
This commit is contained in:
parent
18f87e8c33
commit
2415dc26b0
4 changed files with 21 additions and 2 deletions
|
@ -75,7 +75,7 @@ static uint32_t prvProcessTickInterrupt( void );
|
|||
* attempt to obtain pvInterruptEventMutex if a critical section is used inside
|
||||
* an interrupt handler itself.
|
||||
*/
|
||||
static volatile BaseType_t xInsideInterrupt = pdFALSE;
|
||||
volatile BaseType_t xInsideInterrupt = pdFALSE;
|
||||
|
||||
/*
|
||||
* Called when the process exits to let Windows know the high timer resolution
|
||||
|
@ -394,7 +394,7 @@ CONTEXT xContext;
|
|||
xInsideInterrupt = pdFALSE;
|
||||
WaitForMultipleObjects( sizeof( pvObjectList ) / sizeof( void * ), pvObjectList, TRUE, INFINITE );
|
||||
|
||||
/* /* Cannot be in a critical section to get here. Tasks that exist a
|
||||
/* Cannot be in a critical section to get here. Tasks that exist a
|
||||
critical section will block on a yield mutex to wait for an interrupt to
|
||||
process if an interrupt was set pending while the task was inside the
|
||||
critical section. xInsideInterrupt prevents interrupts that contain
|
||||
|
|
|
@ -74,6 +74,11 @@ typedef unsigned long UBaseType_t;
|
|||
|
||||
#define portYIELD() vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )
|
||||
|
||||
|
||||
extern volatile BaseType_t xInsideInterrupt;
|
||||
#define portSOFTWARE_BARRIER() while( xInsideInterrupt != pdFALSE )
|
||||
|
||||
|
||||
/* Simulated interrupts return pdFALSE if no context switch should be performed,
|
||||
or a non-zero number if a context switch should be performed. */
|
||||
#define portYIELD_FROM_ISR( x ) ( void ) x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue