mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 14:42:10 +01:00
reentrancy fixups
This commit is contained in:
parent
08425ac4c2
commit
37f659ec11
13
ghook.c
13
ghook.c
@ -131,18 +131,9 @@ g_hook_destroy_link (GHookList *hook_list,
|
||||
hook->hook_id = 0;
|
||||
hook->flags &= ~G_HOOK_FLAG_ACTIVE;
|
||||
if (hook_list->hook_destroy)
|
||||
{
|
||||
hook_list->hook_destroy (hook_list, hook);
|
||||
hook->destroy = NULL;
|
||||
}
|
||||
hook_list->hook_destroy (hook_list, hook);
|
||||
else if (hook->destroy)
|
||||
{
|
||||
GDestroyNotify destroy;
|
||||
|
||||
destroy = hook->destroy;
|
||||
hook->destroy = NULL;
|
||||
destroy (hook->data);
|
||||
}
|
||||
hook->destroy (hook->data);
|
||||
g_hook_unref (hook_list, hook); /* counterpart to g_hook_insert_before */
|
||||
}
|
||||
}
|
||||
|
13
glib/ghook.c
13
glib/ghook.c
@ -131,18 +131,9 @@ g_hook_destroy_link (GHookList *hook_list,
|
||||
hook->hook_id = 0;
|
||||
hook->flags &= ~G_HOOK_FLAG_ACTIVE;
|
||||
if (hook_list->hook_destroy)
|
||||
{
|
||||
hook_list->hook_destroy (hook_list, hook);
|
||||
hook->destroy = NULL;
|
||||
}
|
||||
hook_list->hook_destroy (hook_list, hook);
|
||||
else if (hook->destroy)
|
||||
{
|
||||
GDestroyNotify destroy;
|
||||
|
||||
destroy = hook->destroy;
|
||||
hook->destroy = NULL;
|
||||
destroy (hook->data);
|
||||
}
|
||||
hook->destroy (hook->data);
|
||||
g_hook_unref (hook_list, hook); /* counterpart to g_hook_insert_before */
|
||||
}
|
||||
}
|
||||
|
11
glib/gmain.c
11
glib/gmain.c
@ -421,6 +421,12 @@ g_source_destroy_func (GHookList *hook_list,
|
||||
G_LOCK (main_loop);
|
||||
}
|
||||
|
||||
static void
|
||||
g_source_noop (GHookList *hook_list,
|
||||
GHook *hook)
|
||||
{
|
||||
}
|
||||
|
||||
guint
|
||||
g_source_add (gint priority,
|
||||
gboolean can_recurse,
|
||||
@ -437,7 +443,8 @@ g_source_add (gint priority,
|
||||
if (!source_list.is_setup)
|
||||
g_hook_list_init (&source_list, sizeof(GSource));
|
||||
|
||||
source_list.hook_destroy = g_source_destroy_func;
|
||||
source_list.hook_destroy = g_source_noop;
|
||||
source_list.hook_free = g_source_destroy_func;
|
||||
|
||||
source = (GSource *)g_hook_alloc (&source_list);
|
||||
source->priority = priority;
|
||||
@ -1116,7 +1123,7 @@ g_timeout_dispatch (gpointer source_data,
|
||||
{
|
||||
GTimeoutData *data = source_data;
|
||||
|
||||
if (data->callback(user_data))
|
||||
if (data->callback (user_data))
|
||||
{
|
||||
guint seconds = data->interval / 1000;
|
||||
guint msecs = data->interval - seconds * 1000;
|
||||
|
11
gmain.c
11
gmain.c
@ -421,6 +421,12 @@ g_source_destroy_func (GHookList *hook_list,
|
||||
G_LOCK (main_loop);
|
||||
}
|
||||
|
||||
static void
|
||||
g_source_noop (GHookList *hook_list,
|
||||
GHook *hook)
|
||||
{
|
||||
}
|
||||
|
||||
guint
|
||||
g_source_add (gint priority,
|
||||
gboolean can_recurse,
|
||||
@ -437,7 +443,8 @@ g_source_add (gint priority,
|
||||
if (!source_list.is_setup)
|
||||
g_hook_list_init (&source_list, sizeof(GSource));
|
||||
|
||||
source_list.hook_destroy = g_source_destroy_func;
|
||||
source_list.hook_destroy = g_source_noop;
|
||||
source_list.hook_free = g_source_destroy_func;
|
||||
|
||||
source = (GSource *)g_hook_alloc (&source_list);
|
||||
source->priority = priority;
|
||||
@ -1116,7 +1123,7 @@ g_timeout_dispatch (gpointer source_data,
|
||||
{
|
||||
GTimeoutData *data = source_data;
|
||||
|
||||
if (data->callback(user_data))
|
||||
if (data->callback (user_data))
|
||||
{
|
||||
guint seconds = data->interval / 1000;
|
||||
guint msecs = data->interval - seconds * 1000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user