Properly handle concurrency with interrupt handler