using the wakeup_main_function together with dispatch_status_function
jim harvey
jimharvy at gmail.com
Fri Sep 26 07:57:51 PDT 2008
2008/9/26 Havoc Pennington <hp at pobox.com>
> Hi,
>
> On Fri, Sep 26, 2008 at 12:43 AM, jim harvey <jimharvy at gmail.com> wrote:
> > concerning the sending of a message from another thread - i think a more
> > elegant solution would be to use an internal function like:
> >
> > send_msg(conn,msg)
> > {
> > dbus_connection_send(conn,msg,0);
> > my_wakeup_mainloop();
> > }
>
> That makes every module and library in an application process be aware
> of this send_msg() and use it instead of dbus_connection_send()
>
> Also, some API like dbus_bus_add_match() calls send() for you, as
> Thiago mentions
>
yes you're right on that point.
>
> Look, it just is not correct to ask whether you "must" implement the
> dispatch functions, given some specific combination of details of what
> API you're using right now and how dbus works right now. The API
> contract is that you must implement them. If you want to rely on the
> specifics for right now, then you have to read all the source of
> libdbus and your app and figure out what pertains right now. I have no
> idea. But, it's easier and more robust and correct to just follow the
> API contract.
>
Is there a document specifying this API contract? i gather from your comment
that to be on the safe side
i should implement both callbacks and wake the mainloop on both.
Regards,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080926/76f60d9c/attachment.htm
More information about the dbus
mailing list