Thread-safe-wannabe asynchronous loop prototype