[glib] gslice: don't misuse g_mutex_init()



commit 70410b322c6a7cfa047d2a4049d0c810e9a52da8
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Mar 24 21:18:30 2013 -0400

    gslice: don't misuse g_mutex_init()
    
    We were using g_mutex_init() to initialise a pair of mutexes in static
    storage, but we should only do that for mutexes that are part of
    allocated structures.

 glib/gslice.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
---
diff --git a/glib/gslice.c b/glib/gslice.c
index e380b9f..7a8268b 100644
--- a/glib/gslice.c
+++ b/glib/gslice.c
@@ -446,11 +446,9 @@ g_slice_init_nomessage (void)
       allocator->slab_stack = g_new0 (SlabInfo*, MAX_SLAB_INDEX (allocator));
     }
 
-  g_mutex_init (&allocator->magazine_mutex);
   allocator->mutex_counter = 0;
   allocator->stamp_counter = MAX_STAMP_COUNTER; /* force initial update */
   allocator->last_stamp = 0;
-  g_mutex_init (&allocator->slab_mutex);
   allocator->color_accu = 0;
   magazine_cache_update_stamp();
   /* values cached for performance reasons */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]