[cairo-commit] 5 commits - src/cairo-beos-surface.cpp src/cairo-os2-surface.c src/cairo-win32-surface.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Mar 5 12:46:30 PST 2007


 src/cairo-beos-surface.cpp |    8 ++++++--
 src/cairo-os2-surface.c    |   12 ++++++------
 src/cairo-win32-surface.c  |    9 ++++++---
 3 files changed, 18 insertions(+), 11 deletions(-)

New commits:
diff-tree c8b84a4735c46a33620260de0618296df1e12574 (from b8e2888fbed2aefa368d9bab4010c1e807d6389f)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Mar 5 15:46:19 2007 -0500

    [beos] Update mutex initializers
    
    This should be the last one.  We are going to move to a central
    mutex initialization scheme right after 1.4.0 is out.

diff --git a/src/cairo-beos-surface.cpp b/src/cairo-beos-surface.cpp
index 668a209..254ee24 100644
--- a/src/cairo-beos-surface.cpp
+++ b/src/cairo-beos-surface.cpp
@@ -985,16 +985,20 @@ cairo_beos_surface_create_for_bitmap (BV
 
 class BeLocks {
     public:
-	BLocker cairo_toy_font_face_hash_table_mutex;
+	BLocker cairo_font_face_mutex;
 	BLocker cairo_scaled_font_map_mutex;
+#ifdef CAIRO_HAS_FT_FONT
 	BLocker cairo_ft_unscaled_font_map_mutex;
+#endif
 };
 
 static BeLocks locks;
 
-void* cairo_toy_font_face_hash_table_mutex = &locks.cairo_toy_font_face_hash_table_mutex;
+void* cairo_font_face_mutex = &locks.cairo_font_face_mutex;
 void* cairo_scaled_font_map_mutex = &locks.cairo_scaled_font_map_mutex;
+#ifdef CAIRO_HAS_FT_FONT
 void* cairo_ft_unscaled_font_map_mutex = &locks.cairo_ft_unscaled_font_map_mutex;
+#endif
 
 void _cairo_beos_lock (void* locker) {
     BLocker* bLocker = reinterpret_cast<BLocker*>(locker);
diff-tree b8e2888fbed2aefa368d9bab4010c1e807d6389f (from 403b4b7c163e78446035ec5144ad9e3674577d5d)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Mar 5 15:45:45 2007 -0500

    [OS2] Add mutex initializer for cairo_font_face_mutex

diff --git a/src/cairo-os2-surface.c b/src/cairo-os2-surface.c
index 0f91b92..3d46364 100644
--- a/src/cairo-os2-surface.c
+++ b/src/cairo-os2-surface.c
@@ -71,6 +71,7 @@ static int cairo_os2_initialization_coun
 /* The mutex semaphores Cairo uses all around: */
 HMTX cairo_scaled_font_map_mutex = 0;
 HMTX _global_image_glyph_cache_mutex = 0;
+HMTX cairo_font_face_mutex = 0;
 #ifdef CAIRO_HAS_FT_FONT
 HMTX cairo_ft_unscaled_font_map_mutex = 0;
 #endif
@@ -107,6 +108,7 @@ cairo_os2_init (void)
     /* cairo-font.c: */
     DosCreateMutexSem (NULL, &cairo_scaled_font_map_mutex, 0, FALSE);
     DosCreateMutexSem (NULL, &_global_image_glyph_cache_mutex, 0, FALSE);
+    DosCreateMutexSem (NULL, &cairo_font_face_mutex, 0, FALSE);
 
 #ifdef CAIRO_HAS_FT_FONT
     /* cairo-ft-font.c: */
@@ -145,6 +147,10 @@ cairo_os2_fini (void)
         DosCloseMutexSem (_global_image_glyph_cache_mutex);
         _global_image_glyph_cache_mutex = 0;
     }
+    if (cairo_font_face_mutex) {
+        DosCloseMutexSem (cairo_font_face_mutex);
+        cairo_font_face_mutex = 0;
+    }
 
 #ifdef CAIRO_HAS_FT_FONT
     /* cairo-ft-font.c: */
diff-tree 403b4b7c163e78446035ec5144ad9e3674577d5d (from 6358ec539df67ec7725b0687c16f2175386f1b0b)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Mar 5 15:39:09 2007 -0500

    [OS2] Remove unused mutex cairo_toy_font_face_hash_table_mutex

diff --git a/src/cairo-os2-surface.c b/src/cairo-os2-surface.c
index 92bd711..0f91b92 100644
--- a/src/cairo-os2-surface.c
+++ b/src/cairo-os2-surface.c
@@ -69,7 +69,6 @@
 static int cairo_os2_initialization_count = 0;
 
 /* The mutex semaphores Cairo uses all around: */
-HMTX cairo_toy_font_face_hash_table_mutex = 0;
 HMTX cairo_scaled_font_map_mutex = 0;
 HMTX _global_image_glyph_cache_mutex = 0;
 #ifdef CAIRO_HAS_FT_FONT
@@ -106,7 +105,6 @@ cairo_os2_init (void)
     /* Create the mutex semaphores we'll use! */
 
     /* cairo-font.c: */
-    DosCreateMutexSem (NULL, &cairo_toy_font_face_hash_table_mutex, 0, FALSE);
     DosCreateMutexSem (NULL, &cairo_scaled_font_map_mutex, 0, FALSE);
     DosCreateMutexSem (NULL, &_global_image_glyph_cache_mutex, 0, FALSE);
 
@@ -139,10 +137,6 @@ cairo_os2_fini (void)
 
     /* Destroy the mutex semaphores we've created! */
     /* cairo-font.c: */
-    if (cairo_toy_font_face_hash_table_mutex) {
-        DosCloseMutexSem (cairo_toy_font_face_hash_table_mutex);
-        cairo_toy_font_face_hash_table_mutex = 0;
-    }
     if (cairo_scaled_font_map_mutex) {
         DosCloseMutexSem (cairo_scaled_font_map_mutex);
         cairo_scaled_font_map_mutex = 0;
diff-tree 6358ec539df67ec7725b0687c16f2175386f1b0b (from 972f7d9fc8d40fb5c698e1a94fba4f28600b215d)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Mar 5 15:38:52 2007 -0500

    [WIN32] Make cairo_ft_unscaled_font_map_mutex initialization conditional of ft

diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index dee5ebc..24f84c7 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -1896,7 +1896,9 @@ static const cairo_surface_backend_t cai
 #if !defined(HAVE_PTHREAD_H) 
 
 CRITICAL_SECTION cairo_scaled_font_map_mutex;
+#ifdef CAIRO_HAS_FT_FONT
 CRITICAL_SECTION cairo_ft_unscaled_font_map_mutex;
+#endif
 CRITICAL_SECTION cairo_font_face_mutex;
 
 static int _cairo_win32_initialized = 0;
@@ -1908,7 +1910,9 @@ _cairo_win32_initialize (void) {
 
     /* every 'mutex' from CAIRO_MUTEX_DECALRE needs to be initialized here */
     InitializeCriticalSection (&cairo_scaled_font_map_mutex);
+#ifdef CAIRO_HAS_FT_FONT
     InitializeCriticalSection (&cairo_ft_unscaled_font_map_mutex);
+#endif
     InitializeCriticalSection (&cairo_font_face_mutex);
 
     _cairo_win32_initialized = 1;
@@ -1927,7 +1931,9 @@ DllMain (HINSTANCE hinstDLL,
     break;
   case DLL_PROCESS_DETACH:
     DeleteCriticalSection (&cairo_scaled_font_map_mutex);
+#ifdef CAIRO_HAS_FT_FONT
     DeleteCriticalSection (&cairo_ft_unscaled_font_map_mutex);
+#endif
     DeleteCriticalSection (&cairo_font_face_mutex);
     break;
   }
diff-tree 972f7d9fc8d40fb5c698e1a94fba4f28600b215d (from 0cdb96544eda163de050c65f7e7cd413b21f61cc)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Mar 5 15:36:51 2007 -0500

    [WIN32] Remove unused mutex cairo_toy_font_face_hash_table_mutex

diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 3599202..dee5ebc 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -1895,7 +1895,6 @@ static const cairo_surface_backend_t cai
  */
 #if !defined(HAVE_PTHREAD_H) 
 
-CRITICAL_SECTION cairo_toy_font_face_hash_table_mutex;
 CRITICAL_SECTION cairo_scaled_font_map_mutex;
 CRITICAL_SECTION cairo_ft_unscaled_font_map_mutex;
 CRITICAL_SECTION cairo_font_face_mutex;
@@ -1908,7 +1907,6 @@ _cairo_win32_initialize (void) {
 	return;
 
     /* every 'mutex' from CAIRO_MUTEX_DECALRE needs to be initialized here */
-    InitializeCriticalSection (&cairo_toy_font_face_hash_table_mutex);
     InitializeCriticalSection (&cairo_scaled_font_map_mutex);
     InitializeCriticalSection (&cairo_ft_unscaled_font_map_mutex);
     InitializeCriticalSection (&cairo_font_face_mutex);
@@ -1928,7 +1926,6 @@ DllMain (HINSTANCE hinstDLL,
     _cairo_win32_initialize();
     break;
   case DLL_PROCESS_DETACH:
-    DeleteCriticalSection (&cairo_toy_font_face_hash_table_mutex);
     DeleteCriticalSection (&cairo_scaled_font_map_mutex);
     DeleteCriticalSection (&cairo_ft_unscaled_font_map_mutex);
     DeleteCriticalSection (&cairo_font_face_mutex);


More information about the cairo-commit mailing list