ActionBroadcaster message sending safe to use in time critical parts of code?

Is it safe to send ActionBroadcaster messages from time critical parts of code? (they will be received by non time critical threads)

For example, is there a danger that the message sending could block the thread for a short period of time when sending the message from:
void AudioAppComponent::getNextAudioBlock(const juce::AudioSourceChannelInfo& bufferToFill) ?

Hmm, there seems to be a memory allocation inside sendActionMessage(). I guess it’s a no go then.

In addition to the memory allocation you spotted, the implementation of sendActionMessage locks at least two different CriticalSections. It’s possible that these critical sections will be locked at the point where the audio thread tries to claim them, which may lead to priority inversion issues. For these reasons I’d recommend against posting ActionBroadcaster messages from the realtime thread.

Yep, seems like a good idea to avoid ActionBroadcaster messages in realtime areas.

This approach works great for me:
use an atomic<bool> on the real-time thread, and poll that atomic on a different thread with a Timer