cpu/esp32: fix problem with tests/thread_race

The problem seemed to be a pipelining problem of write and read instructions when swapping the context. An isync instruction when returning from a context switch solves the potential pipelining problem.
This commit is contained in:
Gunar Schorcht 2018-10-14 15:08:31 +02:00
parent df1b6521f4
commit 5ef7adfbcb

View File

@ -247,6 +247,13 @@ void thread_yield_higher(void)
} }
#endif #endif
/*
* Instruction fetch synchronize: Waits for all previously fetched load,
* store, cache, and special register write instructions that affect
* instruction fetch to be performed before fetching the next instruction.
*/
__asm__("isync");
return; return;
} }