Is dbus_pending_call_set_notify() thread safe?

Simon McVittie simon.mcvittie at
Tue Jul 31 15:03:54 PDT 2007

On Tue, 31 Jul 2007 at 17:02:54 -0400, Havoc Pennington wrote:
> That aside, I believe what should work is to set your notify, then call 
> dbus_pending_call_steal_reply(). If the reply arrived before you set the 
> notify, then it will be returned from steal_reply().

Surely that can result in the reply getting processed twice, in pathological

> However, libdbus generally avoids convenience API and I'm not sure we 
> need send_with_reply_notify() for the benefit of bindings...

The C part of dbus-python contains a workaround for this race, so yes,
bindings could benefit from an atomic API.


More information about the dbus mailing list