Running MessageManager on non-main thread

I’m working on a JUCE-based shared library that is used in a larger Mac/Windows application.

For performance reasons I’d like to move the message manager thread of the library off of the application’s main thread. This works fine on Windows, but on Mac it fails immediately because the message pump is driven using NSApplication nextEventMatchingMask, which can only be called on the main thread.

Has anyone tried to solve this problem? Or does anyone with more Mac knowledge than me have any idea how hard it would be to accomplish this?