Jan Zerebecki jan.wine@zerebecki.de writes:
This adds thread safety to CreateFakeGLContext and it's corresponding Release function only. This addresses no thread safety in the rest of wined3d, which AFAIk as a whole is still not thread safe. When addressing thread safety in wined3d it must also be taken care that a GL context is not deleted away by a different thread when execution is between these two functions.
You are calling ENTER_GL while holding your crit section, this will deadlock.