summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-08-07 19:58:12 -0400
committerRyan Lortie <desrt@desrt.ca>2010-08-08 12:13:52 -0400
commit2d765e1533321b5421b410217fe2acbe183375eb (patch)
tree1083cd9e1693046f155b3365aa7a777d51ce53d6
parent17bde58552d91d90536458e36445c1eff9d4f0d0 (diff)
Bug 578295 - gtester has a race condition
Deal with the race in GMainLoop by installing a do-nothing timeout.
-rw-r--r--glib/gtester.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/glib/gtester.c b/glib/gtester.c
index ca023f781..12e576c61 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.