Bug 17754 - Fixed race condition in protected_change_timeout.
authorPlácido Revilla <unknown@unknown.domain>
Fri, 11 Jun 2010 16:31:19 +0000 (18:31 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Fri, 11 Jun 2010 16:38:15 +0000 (18:38 +0200)
dbus/dbus-connection.c

index 7f828c5..f5c1872 100644 (file)
@@ -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;
+    }
 }
 
 /**