Call InitializeCriticalSection() on the sdt_mutex in

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().
This commit is contained in:
Tor Lillqvist 2006-12-28 17:55:06 +00:00 committed by Tor Lillqvist
parent 98d5dea18a
commit b5e5d38ce7

View File

@ -359,6 +359,10 @@ g_slice_init_nomessage (void)
/* 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
}
static inline guint
@ -396,12 +400,7 @@ _g_slice_thread_init_nomessage (void)
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();
}
static inline void