Comment #4 on issue 130984 by
sato...@chromium.org: libdbus can easily be
Let's do #2 for now. It's not perfect but better than nothing.
As for more aggressive measures, I have two ideas:
1) Ensure that *all* libdbus functions are called only on D-Bus thread.
As of now most libdbus functions are only called on D-Bus thread, but
dbus_message* are not. I thought using dbus_message* on UI thread was safe,
but we learned that dbus_message_unref() was not safe (
crrev.com/140165),
hence we moved the call to D-Bus thread. We could go further and move
dbus_message* calls to D-Bus thread. To do this, we should copy incoming
D-Bus messages before passing these to callbacks which run on the UI thread.
2) Write our own d-bus implementation in Chrome (i.e. stop using libdbus).
This is a major effort, we'll have full control of the code. My guess is
that we'll need to write 10,000 lines of code even if we only need a subset
of the features provided by libdbus. Not sure if it's worth the investment,
though.
I think 1) is doable in a week.