Bug 10175

Summary: cairo_font_face_mutex missing from cairo-win32-surface.c
Product: cairo Reporter: Bob Jamison <rwjj>
Component: win32 backendAssignee: Owen Taylor <otaylor>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: blocker    
Priority: medium    
Version: 1.3.16   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Bob Jamison 2007-03-03 21:59:14 UTC
cairo_font_face_mutex was inadvertently left out of cairo-win32-surface.c .  The attached patch adds it, and adds calls to InitializeCriticalSection() and DeleteCriticalSection().
Comment 1 Bob Jamison 2007-03-03 22:13:41 UTC
Tried several times to upload this trivial patch, but Bugzilla keeps telling me that the file is empty.  Bugzilla broken?  Until I get it to work, here it is:
====================================================================
--- src/cairo-win32-surface.c.orig	2007-03-02 22:14:56.000000000 -0600
+++ src/cairo-win32-surface.c	2007-03-03 17:54:49.009500000 -0600
@@ -1895,6 +1895,7 @@
  */
 #if !defined(HAVE_PTHREAD_H) 
 
+CRITICAL_SECTION cairo_font_face_mutex;
 CRITICAL_SECTION cairo_toy_font_face_hash_table_mutex;
 CRITICAL_SECTION cairo_scaled_font_map_mutex;
 CRITICAL_SECTION cairo_ft_unscaled_font_map_mutex;
@@ -1908,6 +1909,7 @@
 
     /* every 'mutex' from CAIRO_MUTEX_DECALRE needs to be initialized here */
     InitializeCriticalSection (&cairo_toy_font_face_hash_table_mutex);
+    InitializeCriticalSection (&cairo_font_face_mutex);
     InitializeCriticalSection (&cairo_scaled_font_map_mutex);
     InitializeCriticalSection (&cairo_ft_unscaled_font_map_mutex);
 
@@ -1927,6 +1929,7 @@
     break;
   case DLL_PROCESS_DETACH:
     DeleteCriticalSection (&cairo_toy_font_face_hash_table_mutex);
+    DeleteCriticalSection (&cairo_font_face_mutex);
     DeleteCriticalSection (&cairo_scaled_font_map_mutex);
     DeleteCriticalSection (&cairo_ft_unscaled_font_map_mutex);
     break;

Comment 2 Carl Worth 2007-03-03 22:53:25 UTC
I've now pushed out a fix for this: 

http://gitweb.freedesktop.org/?p=cairo;a=commitdiff;h=325e75239098e640ed05ade39ec2b9f74ae30d3d

(The patch was one from Hans Breuer on the list, but it seemed functionally identical.)

Thanks,

-Carl
Comment 3 Behdad Esfahbod 2007-03-03 23:17:03 UTC
actually cairo_toy_font_face_hash_table_mutex should be removed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.