Improve thread safety of Cairo Font on Windows
Submitted by Fan, Chun-wei
Assigned to cairo-bugs mailing list
Description
Hi,
In its current state, the HDC in cairo-win32-font.c is a static variable that can be compromised if multiple threads are attempting to create HDC's for Windows to render the fonts, making this code thread-unsafe. This also makes PangoCairo (which also relies on this code) unable to run in a thread-safe manner, which I am also trying to investigate and fix1.
This bug attempts to track my try, based on someone else's patch, to tackle this issue.