dbus_pending_call_set_notify race

Alexander Larsson alexl at redhat.com
Thu Nov 30 06:50:39 PST 2006

I just found something i think is racy in the dbus API.

I'm calling dbus_connection_send_with_reply(), possibly not on the same
thread as the mainloop. This queues the message for delivery. It also
returns a DBusPendingCall so i can track recieving the message.

However, what if the mainloop gets scheduled and gets a reply before I
call dbus_pending_call_set_notify. Won't this mean I will miss the
callback? Maybe it should detect that case and call the function (from
an idle (==timeout of zero))?

 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a fiendish Republican astronaut from the 'hood. She's a tortured 
thirtysomething fairy princess with a song in her heart and a spring in her 
step. They fight crime! 

More information about the dbus mailing list