Bugzilla – Attachment 71101 Details for
Bug 154916
D-BUS pending calls blocks on poll
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Upstream fix
dbus-connection-blocks-on-poll.diff (text/plain), 2.71 KB, created by
Timo Hoenig
on 2006-03-03 07:41:34 UTC
(
hide
)
Description:
Upstream fix
Filename:
MIME Type:
Creator:
Timo Hoenig
Created:
2006-03-03 07:41:34 UTC
Size:
2.71 KB
patch
obsolete
>=================================================================== >RCS file: /srv/anoncvs.freedesktop.org/cvs/dbus/dbus/dbus/dbus-connection.c,v >retrieving revision 1.115 >retrieving revision 1.116 >diff -u -r1.115 -r1.116 >--- dbus-connection.c 2005/11/30 20:30:02 1.115 >+++ dbus-connection.c 2006/03/02 22:24:28 1.116 >@@ -2533,6 +2533,36 @@ > return NULL; > } > >+static dbus_bool_t >+check_for_reply_and_update_dispatch_unlocked (DBusPendingCall *pending) >+{ >+ DBusMessage *reply; >+ DBusDispatchStatus status; >+ DBusConnection *connection; >+ >+ connection = pending->connection; >+ >+ reply = check_for_reply_unlocked (connection, pending->reply_serial); >+ if (reply != NULL) >+ { >+ _dbus_verbose ("%s checked for reply\n", _DBUS_FUNCTION_NAME); >+ >+ _dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n"); >+ >+ _dbus_pending_call_complete_and_unlock (pending, reply); >+ dbus_message_unref (reply); >+ >+ CONNECTION_LOCK (connection); >+ status = _dbus_connection_get_dispatch_status_unlocked (connection); >+ _dbus_connection_update_dispatch_status_and_unlock (connection, status); >+ dbus_pending_call_unref (pending); >+ >+ return TRUE; >+ } >+ >+ return FALSE; >+} >+ > /** > * When a function that blocks has been called with a timeout, and we > * run out of memory, the time to wait for memory is based on the >@@ -2616,6 +2646,11 @@ > start_tv_sec, start_tv_usec, > end_tv_sec, end_tv_usec); > >+ /* check to see if we already got the data off the socket */ >+ /* from another blocked pending call */ >+ if (check_for_reply_and_update_dispatch_unlocked (pending)) >+ return; >+ > /* Now we wait... */ > /* always block at least once as we know we don't have the reply yet */ > _dbus_connection_do_iteration_unlocked (connection, >@@ -2645,27 +2680,8 @@ > } > > if (status == DBUS_DISPATCH_DATA_REMAINS) >- { >- DBusMessage *reply; >- >- reply = check_for_reply_unlocked (connection, client_serial); >- if (reply != NULL) >- { >- _dbus_verbose ("%s checked for reply\n", _DBUS_FUNCTION_NAME); >- >- _dbus_verbose ("dbus_connection_send_with_reply_and_block(): got reply\n"); >- >- _dbus_pending_call_complete_and_unlock (pending, reply); >- dbus_message_unref (reply); >- >- CONNECTION_LOCK (connection); >- status = _dbus_connection_get_dispatch_status_unlocked (connection); >- _dbus_connection_update_dispatch_status_and_unlock (connection, status); >- dbus_pending_call_unref (pending); >- >- return; >- } >- } >+ if (check_for_reply_and_update_dispatch_unlocked (pending)) >+ return; > > _dbus_get_current_time (&tv_sec, &tv_usec); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 154916
: 71101