Explain how you would safely share data between an interrupt service routine and the main application loop.