I don't think it's a good idea to rely on gdiplus functions being
called from only one thread. Most of gdiplus currently is not
thread-safe (maybe it should be), but it will work as long as a single
object is only used from a single thread at a time.

Adding global state makes things more complex, and that's part of the
reason I think it's better not to put it in the initial
implementation. If you do add it, I think you should do it in a
separate patch.

(I must confess my implementation of GdipNewInstalledFontCollection
breaks the little thread-safety we have, but the race condition
happens only the first time it's called.)

You can clean up global data in DllMain in the PROCESS_DETACH case.

-- 
Vincent Povirk


Reply via email to