Remove global state
Using global state (ShInitialize, InitGlobalLock, PerProcessGPA etc.) is bad API design and makes using glslang in multi-threaded applications both risky and difficult.
You should group this global state into a “context” struct and pass it around explicitly where needed.
It would be great if this context could be available to the C API too.
See #976 which is a plan to at least partially address this. Would be great to have some feedback on it.
If there is still a problem with global state, we need a proposal for fixing it without breaking existing uses, but rather deprecating current use, leaving an overlap between current use and a safer model.
Well, the "old" APIs, which require global context, could probably be easily emulated. You'd just have the init functions create a global object or such.
I admit I'm unfamiliar with the implementation, though.
Another piece of removing global state, or rather converting it to constant data: https://github.com/KhronosGroup/glslang/pull/3720. The only global data left are the symbol tables and the global PoolAllocator.