#define g_union_volume_monitor_get_type _g_union_volume_monitor_get_type
G_DEFINE_TYPE (GUnionVolumeMonitor, g_union_volume_monitor, G_TYPE_VOLUME_MONITOR);
-static GStaticRecMutex the_volume_monitor_mutex = G_STATIC_REC_MUTEX_INIT;
+static GRecMutex the_volume_monitor_mutex = G_REC_MUTEX_INIT;
static GUnionVolumeMonitor *the_volume_monitor = NULL;
monitor = G_UNION_VOLUME_MONITOR (object);
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
the_volume_monitor = NULL;
for (l = monitor->monitors; l != NULL; l = l->next)
g_object_run_dispose (G_OBJECT (child_monitor));
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
G_OBJECT_CLASS (g_union_volume_monitor_parent_class)->dispose (object);
}
res = NULL;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
for (l = monitor->monitors; l != NULL; l = l->next)
{
res = g_list_concat (res, g_volume_monitor_get_mounts (child_monitor));
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return res;
}
res = NULL;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
for (l = monitor->monitors; l != NULL; l = l->next)
{
res = g_list_concat (res, g_volume_monitor_get_volumes (child_monitor));
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return res;
}
res = NULL;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
for (l = monitor->monitors; l != NULL; l = l->next)
{
res = g_list_concat (res, g_volume_monitor_get_connected_drives (child_monitor));
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return res;
}
volume = NULL;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
for (l = monitor->monitors; l != NULL; l = l->next)
{
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return volume;
}
mount = NULL;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
for (l = monitor->monitors; l != NULL; l = l->next)
{
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return mount;
}
{
GVolumeMonitor *vm;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
if (the_volume_monitor)
vm = G_VOLUME_MONITOR (g_object_ref (the_volume_monitor));
vm = G_VOLUME_MONITOR (the_volume_monitor);
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return vm;
}
if (klass->get_mount_for_mount_path)
{
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
mount = klass->get_mount_for_mount_path (mount_path, cancellable);
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
}
/* TODO: How do we know this succeeded? Keep in mind that the native
volume = NULL;
- g_static_rec_mutex_lock (&the_volume_monitor_mutex);
+ g_rec_mutex_lock (&the_volume_monitor_mutex);
for (l = the_volume_monitor->monitors; l != NULL; l = l->next)
{
}
}
- g_static_rec_mutex_unlock (&the_volume_monitor_mutex);
+ g_rec_mutex_unlock (&the_volume_monitor_mutex);
return volume;
}
}
/* == new/ref/unref == */
-static GStaticRecMutex g_variant_type_info_lock = G_STATIC_REC_MUTEX_INIT;
+static GRecMutex g_variant_type_info_lock = G_REC_MUTEX_INIT;
static GHashTable *g_variant_type_info_table;
/* < private >
type_string = g_variant_type_dup_string (type);
- g_static_rec_mutex_lock (&g_variant_type_info_lock);
+ g_rec_mutex_lock (&g_variant_type_info_lock);
if (g_variant_type_info_table == NULL)
g_variant_type_info_table = g_hash_table_new (g_str_hash,
else
g_variant_type_info_ref (info);
- g_static_rec_mutex_unlock (&g_variant_type_info_lock);
+ g_rec_mutex_unlock (&g_variant_type_info_lock);
g_variant_type_info_check (info, 0);
g_free (type_string);
{
ContainerInfo *container = (ContainerInfo *) info;
- g_static_rec_mutex_lock (&g_variant_type_info_lock);
+ g_rec_mutex_lock (&g_variant_type_info_lock);
if (g_atomic_int_dec_and_test (&container->ref_count))
{
g_hash_table_remove (g_variant_type_info_table,
g_hash_table_unref (g_variant_type_info_table);
g_variant_type_info_table = NULL;
}
- g_static_rec_mutex_unlock (&g_variant_type_info_lock);
+ g_rec_mutex_unlock (&g_variant_type_info_lock);
g_free (container->type_string);
g_assert_not_reached ();
}
else
- g_static_rec_mutex_unlock (&g_variant_type_info_lock);
+ g_rec_mutex_unlock (&g_variant_type_info_lock);
}
}
module_debug_initialized = TRUE;
}
-static GStaticRecMutex g_module_global_lock = G_STATIC_REC_MUTEX_INIT;
+static GRecMutex g_module_global_lock = G_REC_MUTEX_INIT;
GModule*
g_module_open (const gchar *file_name,
SUPPORT_OR_RETURN (NULL);
- g_static_rec_mutex_lock (&g_module_global_lock);
+ g_rec_mutex_lock (&g_module_global_lock);
if (G_UNLIKELY (!module_debug_initialized))
_g_module_debug_init ();
else
main_module->ref_count++;
- g_static_rec_mutex_unlock (&g_module_global_lock);
+ g_rec_mutex_unlock (&g_module_global_lock);
return main_module;
}
{
module->ref_count++;
- g_static_rec_mutex_unlock (&g_module_global_lock);
+ g_rec_mutex_unlock (&g_module_global_lock);
return module;
}
module->ref_count++;
g_module_set_error (NULL);
- g_static_rec_mutex_unlock (&g_module_global_lock);
+ g_rec_mutex_unlock (&g_module_global_lock);
return module;
}
(module_debug_flags & G_MODULE_DEBUG_RESIDENT_MODULES))
g_module_make_resident (module);
- g_static_rec_mutex_unlock (&g_module_global_lock);
+ g_rec_mutex_unlock (&g_module_global_lock);
return module;
}
g_return_val_if_fail (module != NULL, FALSE);
g_return_val_if_fail (module->ref_count > 0, FALSE);
- g_static_rec_mutex_lock (&g_module_global_lock);
+ g_rec_mutex_lock (&g_module_global_lock);
module->ref_count--;
g_free (module);
}
- g_static_rec_mutex_unlock (&g_module_global_lock);
+ g_rec_mutex_unlock (&g_module_global_lock);
return g_module_error() == NULL;
}
g_return_val_if_fail (symbol_name != NULL, FALSE);
g_return_val_if_fail (symbol != NULL, FALSE);
- g_static_rec_mutex_lock (&g_module_global_lock);
+ g_rec_mutex_lock (&g_module_global_lock);
#ifdef G_MODULE_NEED_USCORE
{
*symbol = NULL;
}
- g_static_rec_mutex_unlock (&g_module_global_lock);
+ g_rec_mutex_unlock (&g_module_global_lock);
return !module_error;
}
/* --- variables --- */
static GStaticRWLock type_rw_lock = G_STATIC_RW_LOCK_INIT;
-static GStaticRecMutex class_init_rec_mutex = G_STATIC_REC_MUTEX_INIT;
+static GRecMutex class_init_rec_mutex = G_REC_MUTEX_INIT;
static guint static_n_class_cache_funcs = 0;
static ClassCacheFunc *static_class_cache_funcs = NULL;
static guint static_n_iface_check_funcs = 0;
g_assert (current > 0);
- g_static_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
+ g_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
G_WRITE_LOCK (&type_rw_lock);
type_data_last_unref_Wm (node, uncached);
G_WRITE_UNLOCK (&type_rw_lock);
- g_static_rec_mutex_unlock (&class_init_rec_mutex);
+ g_rec_mutex_unlock (&class_init_rec_mutex);
return;
}
} while (!g_atomic_int_compare_and_exchange ((int *) &node->ref_count, current, current - 1));
* class initialized, however this function is rarely enough called to take
* the simple route and always acquire class_init_rec_mutex.
*/
- g_static_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
+ g_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
G_WRITE_LOCK (&type_rw_lock);
if (check_add_interface_L (instance_type, interface_type))
{
type_add_interface_Wm (node, iface, info, NULL);
}
G_WRITE_UNLOCK (&type_rw_lock);
- g_static_rec_mutex_unlock (&class_init_rec_mutex);
+ g_rec_mutex_unlock (&class_init_rec_mutex);
}
/**
return;
/* see comment in g_type_add_interface_static() about class_init_rec_mutex */
- g_static_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
+ g_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
G_WRITE_LOCK (&type_rw_lock);
if (check_add_interface_L (instance_type, interface_type))
{
type_add_interface_Wm (node, iface, NULL, plugin);
}
G_WRITE_UNLOCK (&type_rw_lock);
- g_static_rec_mutex_unlock (&class_init_rec_mutex);
+ g_rec_mutex_unlock (&class_init_rec_mutex);
}
* node->data->class.init_state == INITIALIZED, because any
* concurrently running initialization was guarded by class_init_rec_mutex.
*/
- g_static_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
+ g_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
/* we need an initialized parent class for initializing derived classes */
ptype = NODE_PARENT_TYPE (node);
if (pclass)
g_type_class_unref (pclass);
- g_static_rec_mutex_unlock (&class_init_rec_mutex);
+ g_rec_mutex_unlock (&class_init_rec_mutex);
return node->data->class.class;
}
if (!node->data || !node->data->iface.dflt_vtable)
{
G_WRITE_UNLOCK (&type_rw_lock);
- g_static_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
+ g_rec_mutex_lock (&class_init_rec_mutex); /* required locking order: 1) class_init_rec_mutex, 2) type_rw_lock */
G_WRITE_LOCK (&type_rw_lock);
node = lookup_type_node_I (g_type);
type_data_ref_Wm (node);
type_iface_ensure_dflt_vtable_Wm (node);
- g_static_rec_mutex_unlock (&class_init_rec_mutex);
+ g_rec_mutex_unlock (&class_init_rec_mutex);
}
else
type_data_ref_Wm (node); /* ref_count >= 1 already */