From b82ff17d7dd9689ab664e4a6c2a86c6f3dbfba69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pl=C3=A1cido=20Revilla?= Date: Fri, 11 Jun 2010 18:31:19 +0200 Subject: [PATCH] Bug 17754 - Fixed race condition in protected_change_timeout. --- dbus/dbus-connection.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c index 7f828c5fc..f5c1872a5 100644 --- a/dbus/dbus-connection.c +++ b/dbus/dbus-connection.c @@ -785,6 +785,7 @@ protected_change_timeout (DBusConnection *connection, * drop lock and call out" one; but it has to be propagated up through all callers */ +retry: timeouts = connection->timeouts; if (timeouts) { @@ -812,7 +813,12 @@ protected_change_timeout (DBusConnection *connection, return retval; } else - return FALSE; + { + CONNECTION_UNLOCK (connection); + usleep(1000); + CONNECTION_LOCK (connection); + goto retry; + } } /** -- 2.47.3