terminating execution of loop()

What is the desired way to stop the execution of loop(), other than

setting a flag, checking the flag, then sitting in a while 1 loop?

I don't see anything obvious here