The doc comments for this global said: "Locked to avoid interleaving panic messages from multiple threads." Huh? There's already a mutex for that, it's the stderr mutex. Lock that one instead.
@expect