static GSList *g_thread_free_indices = NULL;
/* Protects g_thread_all_threads and g_thread_free_indices */
+G_LOCK_DEFINE_STATIC (g_static_mutex);
G_LOCK_DEFINE_STATIC (g_thread);
/* Misc. GThread functions {{{1 */
if (!result)
{
- g_mutex_lock (&g_once_mutex);
+ G_LOCK (g_static_mutex);
result = mutex->mutex;
if (!result)
g_atomic_pointer_set (&mutex->mutex, result);
}
- g_mutex_unlock (&g_once_mutex);
+ G_UNLOCK (g_static_mutex);
}
return result;
if (!result)
{
- g_mutex_lock (&g_once_mutex);
+ G_LOCK (g_static_mutex);
result = (GRecMutex *) mutex->mutex.mutex;
if (!result)
g_atomic_pointer_set (&mutex->mutex.mutex, result);
}
- g_mutex_unlock (&g_once_mutex);
+ G_UNLOCK (g_static_mutex);
}
return result;
/* Local Data {{{1 -------------------------------------------------------- */
-GMutex g_once_mutex;
+static GMutex g_once_mutex;
static GCond g_once_cond;
static GSList *g_once_init_list = NULL;