Hi,
I have a general threading question: (K60 MCU)
Let say SPI module is setup and enabled with interrupt. The interrput is serviced through module Event:
void SM1_OnBlockSent(LDD_TUserData *UserDataPtr) {
//
iSharedVariableCmdSentDone=1;
}
is the accessing of the iSharedVariableCmdSentDone thread-safe in the SM1_OnBlockSent() ?
Thank you,
David Zhou
Solved! Go to Solution.
Hello David
The global variables in ISR routines generated by PE are not thread-safe. The ISRs are not reentrant functions. User needs to pay attention in his application code to protect the data.
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Mark Correct button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello David
The global variables in ISR routines generated by PE are not thread-safe. The ISRs are not reentrant functions. User needs to pay attention in his application code to protect the data.
Best Regards
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Mark Correct button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Fiona,
Thank you for your answer.
David Zhou