On mac at least,
getCurrentThreadId() resolves into a call to pthread_self(), which is a system function. That function is called by the function that in turns determines if we are in the message thread or not.
The dogma says that system functions must not be called from the realtime (audio) thread because they aren’t guaranteed to return in a predictable (short) time.
I think it would be reasonable that a function used to check whether we’re in the message thread should be callable from the realtime thread, right?
But given its current implementation, that seems to go against the dogma.
What should we do to check whether we’re in the message thread, with code that could potentially be called from the audio thread?