volatile bool live = true;
volatile int exit_code = ERR_SUCCESS;
volatile bool good = true;
int main() {
while(live) {
do_something(good);
if(dead) {
exit(exit_code);
}
}
return 0;
}