That solution is non-ideal. Suppose "someSensorFunction()" or "(whatever)" causes flag = 1. Then the 'if' statement evaluates to true:
if ( flag ) {
magicBus();
flag = 0;
}
But, what if interrupt occurs while body of 'if' statement is executing:
if ( flag ) {
magicBus();
<-------- Interrupt occurs here and sets flag = 1
flag = 0; <-------- flag set to 0.
}
So, next time through loop(), the call to magicBus() that should take place due to interrupt won't happen.
Guess it depends how critical that is to your application.