Atomic operation in multithreaded embedded software
问题 I have been developing an RTOS based embedded software in C and I have encountered a problem regarding shared resource access from several threads. I have two problems. The first one is seting and getting a value of state variable in state machine. Below is the header file for StateMachine "object": typedef enum{ STATE_01, STATE_02, STATE_03, STATE_04 }state_e; // state machine instance typedef struct{ state_e currState; }StateMachine; extern state_e GetState(StateMachine*); extern void