Commit b5e5d38c authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

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().
parent 98d5dea1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment