From: Plácido Revilla Date: Fri, 11 Jun 2010 16:31:19 +0000 (+0200) Subject: Bug 17754 - Fixed race condition in protected_change_timeout. X-Git-Tag: dbus-1.3.1~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b82ff17d7dd9689ab664e4a6c2a86c6f3dbfba69;p=thirdparty%2Fdbus.git Bug 17754 - Fixed race condition in protected_change_timeout. --- 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; + } } /**