[glib/glib-2-24] Bug 578295 - gtester has a race condition
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-24] Bug 578295 - gtester has a race condition
- Date: Sun, 8 Aug 2010 16:13:57 +0000 (UTC)
commit 2d765e1533321b5421b410217fe2acbe183375eb
Author: Ryan Lortie <desrt desrt ca>
Date: Sat Aug 7 19:58:12 2010 -0400
Bug 578295 - gtester has a race condition
Deal with the race in GMainLoop by installing a do-nothing timeout.
glib/gtester.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/glib/gtester.c b/glib/gtester.c
index ca023f7..12e576c 100644
--- a/glib/gtester.c
+++ b/glib/gtester.c
@@ -620,12 +620,21 @@ parse_args (gint *argc_p,
*argc_p = e;
}
+static gboolean
+do_nothing (gpointer data)
+{
+ return TRUE;
+}
+
int
main (int argc,
char **argv)
{
guint ui;
+ /* See #578295 */
+ g_timeout_add_seconds (5, do_nothing, NULL);
+
/* some unices need SA_RESTART for SIGCHLD to return -EAGAIN for io.
* we must fiddle with sigaction() *before* glib is used, otherwise
* we could revoke signal hanmdler setups from glib initialization code.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]