Check if on audio thread

You may check this other topic: Class for detecting unsafe operations in realtime contexts