Re: [PATCH 1/2] do not wake up main loop adding if change is from same thread
- From: Emmanuele Bassi <ebassi gmail com>
- To: Frediano Ziglio <fziglio redhat com>
- Cc: GTK Devel List <gtk-devel-list gnome org>
- Subject: Re: [PATCH 1/2] do not wake up main loop adding if change is from same thread
- Date: Mon, 25 Jan 2016 15:36:14 +0000
Hi;
Thanks for you patches.
GLib uses Bugzilla[0] to track patches and contributions. Please, use:
https://bugzilla.gnome.org/enter_bug.cgi?product=glib
to file a bug report and attach your patches there.
Thanks again!
Ciao,
Emmanuele.
On 25 January 2016 at 15:08, Frediano Ziglio <fziglio redhat com> wrote:
This reduce the frequency the loop is waked up adding and removing
file descriptors or timeouts.
Considering that to support recursion events are removed from list and
added again this reduce iteration number a lot.
Signed-off-by: Frediano Ziglio <fziglio redhat com>
---
glib/gmain.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/glib/gmain.c b/glib/gmain.c
index 29ccee0..1e9850f 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -1797,7 +1797,8 @@ g_source_set_ready_time (GSource *source,
{
/* Quite likely that we need to change the timeout on the poll */
if (!SOURCE_BLOCKED (source))
- g_wakeup_signal (context->wakeup);
+ if (context->owner && context->owner != G_THREAD_SELF)
+ g_wakeup_signal (context->wakeup);
UNLOCK_CONTEXT (context);
}
}
@@ -4259,7 +4260,8 @@ g_main_context_add_poll_unlocked (GMainContext *context,
context->poll_changed = TRUE;
/* Now wake up the main loop if it is waiting in the poll() */
- g_wakeup_signal (context->wakeup);
+ if (context->owner && context->owner != G_THREAD_SELF)
+ g_wakeup_signal (context->wakeup);
}
/**
@@ -4319,7 +4321,8 @@ g_main_context_remove_poll_unlocked (GMainContext *context,
context->poll_changed = TRUE;
/* Now wake up the main loop if it is waiting in the poll() */
- g_wakeup_signal (context->wakeup);
+ if (context->owner && context->owner != G_THREAD_SELF)
+ g_wakeup_signal (context->wakeup);
}
/**
--
2.4.3
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list
--
https://www.bassi.io
[ ] ebassi [ gmail com]
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]