Instances of RawDBusConnection can now be contained in nsRefPtr. This
allows to share the DBus connection among multiple threads.
--HG--
extra : rebase_source : fb24472b3b55e77abc7354f17ef679661f62b7fb
The new function allows to schedule nsRunnables to an existing DBus
thread. This intercepts the running instance of DBusPollTask and
makes the DBus thread process the dispatched runnable. The intercepted
poll task automatically continues polling once all pending runnables
have been processed.
This patch replaces the DBus EventLoop function by an instance
of DBusPollTask. It also cleans up the initialization and shutdown
code of the DBusThread.
This patch adds class DBusPollTask. The DBusPollTask class is an
nsRunnable for receiving DBus messages. It is intended to run in
a separate thread that is dedicated to DBus only.
The Run function of the poll task resembles the DBus EventLoop
function, but allows to intercept execution in favor of other
nsRunnables. Afterwards the DBusPollTask continues.
We intent to run the DBus thread's EventLoop function as separate
nsRunnable, but the function also contains code for initializing
sockets that are used for internal communication.
With this patch the socket initialization has been moved to the
setup function. This reduces the EventLoop function to plain event
handling.