2006-12-28 Tor Lillqvist <tml@novell.com>
* glib/gslice.c: Call InitializeCriticalSection() on the
sdt_mutex in g_slice_init_nomessage() and not in
_g_slice_thread_init_nomessage(), which is called only through
g_thread_init(). Not all programs call g_thread_init().
/* at this point, g_mem_gc_friendly() should be initialized, this
* should have been accomplished by the above g_malloc/g_new calls
*/
/* at this point, g_mem_gc_friendly() should be initialized, this
* should have been accomplished by the above g_malloc/g_new calls
*/
+#ifdef G_OS_WIN32
+ if (allocator->config.debug_blocks)
+ InitializeCriticalSection (&sdt_mutex);
+#endif
allocator->magazine_mutex = g_mutex_new();
allocator->slab_mutex = g_mutex_new();
if (allocator->config.debug_blocks)
allocator->magazine_mutex = g_mutex_new();
allocator->slab_mutex = g_mutex_new();
if (allocator->config.debug_blocks)
- {
- smc_tree_mutex = g_mutex_new();
-#ifdef G_OS_WIN32
- InitializeCriticalSection (&sdt_mutex);
-#endif
- }
+ smc_tree_mutex = g_mutex_new();