Pending Calls and Asynchronous functions

jaikumar Ganesh jaikumarg at gmail.com
Tue Mar 23 15:52:57 PDT 2010


Hello folks,
    I have the following calls:

               reply = dbus_connection_send_with_reply(conn, msg, &call,

 timeout_ms);
               if (reply == TRUE) {
                             dbus_pending_call_set_notify(call,

callback,

pending,

NULL);
               }

So I get a reply from the other end (very quickly) and before a pending
function can get set in dbus_pending_call_set_notify.
And thus when _dbus_pending_call_complete is called I don't get the callback
because pending->function is NULL.

This is a race condition and I hit it 50 % of the times depending on how
loaded the system is.

Is there a better way to set the pending call ? Am I using it wrongly ?

Thanks
Jaikumar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100323/14b31cc7/attachment.htm>


More information about the dbus mailing list