thiago.macieira at trolltech.com
Sun Feb 26 04:10:01 PST 2006
Havoc Pennington wrote:
>On Sun, 2006-02-26 at 02:56 +0100, Thiago Macieira wrote:
>> >There are several ways I can think of that a handler would know it's
>> >being called the first time or the second time; any thoughts on that?
>> I think the most inobtrusive way to do this is to overload
>> dbus_connection_add_filter into dbus_connection_add_filter2 that takes
>> two functions as parameters. The second one would be called when the
>> lock has been released.
>Another possible approach is that you could track it via the user_data,
>e.g. you'd have a flag in user_data for "I just returned
>PARTIALLY_HANDLED" - I don't know what you're using user_data for
>already so maybe this is not good, depending.
That requires a stateful approach and I'd rather avoid that.
user_data is shared among threads. So, if another thread is waiting for
the dispatch lock to be released, the filter could be called again for a
new message before the continuation handler were called. I could add a
semaphore to avoid that, but I'd rather not to, if possible.
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060226/5d6e6d98/attachment.pgp
More information about the dbus