In the other forum thread about the newly added static void callAsync (std::function<void(void)>) method in MessageManager, I posted an alternative way to do it and speculated it should work OK on OS-X too, because it does seem to do so on Windows. However, now that I tested it on OS-X, it does not work. There happens a hang when Juce GUI objects are manipulated. I suspected that perhaps my wrapper function causes something bad to happen. But callFunctionOnMessageThread does not seem to be working on OS-X when called directly either, similar to :
void* label_cb_func(void* ctx)
(std::async is a way to run a callable in another thread)
The code I have tested with is not exactly like above. The mywindow:foo() is actually a method that opens up a Juce Popupmenu and async stuff is launched when choosing a menu item. I wonder if the menu still being open while the async/MessageManager stuff is happening causes some havoc...?