C/C++ Cross Platform Escape Asynchronous Loop