If I understand correctly, this problem is caused when you call initialize in another thread, and while that is running, you fork.
It affects these app servers because this is triggered at "require" (or "import") time. This is madness, no module should run code just when you import it. OK, I have been guilty of that, too. But if absolutely neccessary, keep it to a minimum. It breaks all kind of things when module imports are not side-effect-free.
Launching a thread and (indirectly) taking a mutex is definitely not something you should do on module import!
One of the rules that Apple defined is that you may not call Foundation class initializers after forking.
Maybe there is an internal `mark_exec_as_called()` function that you could exploit, if you are forking without exec...
> Exception: processes that are single-threaded when fork() is called have no restrictions on +initialize in the child. Examples: sshd and httpd.
¹ https://opensource.apple.com/source/objc4/objc4-723/runtime/...