https://github.com/ucpu/cage/blob/bb2b554601faa380c0010b50317c9bff0ebdcfbc/sources/libsimple/gameloop.cpp
replace the big macro with a template
ensure that control finalization is run only after graphics/sound reaches stop stage
ensure barriers cannot deadlock
https://github.com/ucpu/cage/blob/bb2b554601faa380c0010b50317c9bff0ebdcfbc/sources/libsimple/gameloop.cpp
replace the big macro with a template
ensure that control finalization is run only after graphics/sound reaches stop stage
ensure barriers cannot deadlock