http://lists.freedesktop.org/archives/dbus/2010-March/012337.html
Previously, the watch handler would block until the I/O path was available.
However, if another non-main thread was doing a synchronous call, this would
cause the main thread to block on that thread, a highly undesirable
thing because it's important for the main thread to remain responsive
for user interfaces.
Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Thiago Macieira <thiago@kde.org>
_dbus_verbose ("%s start\n", _DBUS_FUNCTION_NAME);
CONNECTION_LOCK (connection);
- _dbus_connection_acquire_io_path (connection, -1);
+
+ if (!_dbus_connection_acquire_io_path (connection, 1))
+ {
+ /* another thread is handling the message */
+ CONNECTION_UNLOCK (connection);
+ return TRUE;
+ }
+
HAVE_LOCK_CHECK (connection);
retval = _dbus_transport_handle_watch (connection->transport,
watch, condition);