How to execute gameplay code from the audio thread

I changed it to a polling implementation, what do you think?