How do you safely share data between an Interrupt Service Routine (ISR) and the main application loop?