From 5b4af3060f292551e189f458406251319a54501d Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 7 Apr 2003 17:50:53 +0000 Subject: [PATCH] When waiting for the main loop to be freed up, wait on either Mon Apr 7 13:40:28 2003 Owen Taylor * glib/gmain.c (g_main_loop_run): When waiting for the main loop to be freed up, wait on either !loop->is_running or got_ownership, not both. (Caused gtk_dialog_run() not to work in other threads, reported by Jean-Yves Lefort) --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-12 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ glib/gmain.c | 2 +- 7 files changed, 49 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ef65669..df8e978 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Apr 7 13:40:28 2003 Owen Taylor + + * glib/gmain.c (g_main_loop_run): When waiting for + the main loop to be freed up, wait on either + !loop->is_running or got_ownership, not both. + (Caused gtk_dialog_run() not to work in other + threads, reported by Jean-Yves Lefort) + 2003-04-07 Matthias Clasen * glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ef65669..df8e978 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Apr 7 13:40:28 2003 Owen Taylor + + * glib/gmain.c (g_main_loop_run): When waiting for + the main loop to be freed up, wait on either + !loop->is_running or got_ownership, not both. + (Caused gtk_dialog_run() not to work in other + threads, reported by Jean-Yves Lefort) + 2003-04-07 Matthias Clasen * glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ef65669..df8e978 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,11 @@ +Mon Apr 7 13:40:28 2003 Owen Taylor + + * glib/gmain.c (g_main_loop_run): When waiting for + the main loop to be freed up, wait on either + !loop->is_running or got_ownership, not both. + (Caused gtk_dialog_run() not to work in other + threads, reported by Jean-Yves Lefort) + 2003-04-07 Matthias Clasen * glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ef65669..df8e978 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Apr 7 13:40:28 2003 Owen Taylor + + * glib/gmain.c (g_main_loop_run): When waiting for + the main loop to be freed up, wait on either + !loop->is_running or got_ownership, not both. + (Caused gtk_dialog_run() not to work in other + threads, reported by Jean-Yves Lefort) + 2003-04-07 Matthias Clasen * glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ef65669..df8e978 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Apr 7 13:40:28 2003 Owen Taylor + + * glib/gmain.c (g_main_loop_run): When waiting for + the main loop to be freed up, wait on either + !loop->is_running or got_ownership, not both. + (Caused gtk_dialog_run() not to work in other + threads, reported by Jean-Yves Lefort) + 2003-04-07 Matthias Clasen * glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ef65669..df8e978 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Apr 7 13:40:28 2003 Owen Taylor + + * glib/gmain.c (g_main_loop_run): When waiting for + the main loop to be freed up, wait on either + !loop->is_running or got_ownership, not both. + (Caused gtk_dialog_run() not to work in other + threads, reported by Jean-Yves Lefort) + 2003-04-07 Matthias Clasen * glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0. diff --git a/glib/gmain.c b/glib/gmain.c index 3f7d70e..f8e2c34 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -2466,7 +2466,7 @@ g_main_loop_run (GMainLoop *loop) if (!loop->context->cond) loop->context->cond = g_cond_new (); - while (loop->is_running || !got_ownership) + while (loop->is_running && !got_ownership) got_ownership = g_main_context_wait (loop->context, loop->context->cond, g_static_mutex_get_mutex (&loop->context->mutex)); -- 2.7.4