From: Ryan Lortie Date: Sat, 7 Aug 2010 23:58:12 +0000 (-0400) Subject: Bug 578295 - gtester has a race condition X-Git-Tag: 2.25.14~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01cae84e47ff749e475d7931106c8b00829021e5;p=platform%2Fupstream%2Fglib.git Bug 578295 - gtester has a race condition Deal with the race in GMainLoop by installing a do-nothing timeout. --- 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.