gecko-dev/ipc/dbus/DBusThread.h
Thomas Zimmermann 09ba3f9b43 Bug 830290: Added dispatch function for DBus thread r=bent,qdot
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.
2013-01-14 11:50:27 +01:00

47 lines
1.1 KiB
C++

/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_ipc_dbus_gonk_dbusthread_h__
#define mozilla_ipc_dbus_gonk_dbusthread_h__
#include "nscore.h"
class nsIRunnable;
namespace mozilla {
namespace ipc {
/**
* Starts the DBus thread, which handles returning signals to objects
* that call asynchronous functions. This should be called from the
* main thread at startup.
*
* @return True on thread starting correctly, false otherwise
*/
bool StartDBus();
/**
* Stop the DBus thread, assuming it's currently running. Should be
* called from main thread.
*
* @return True on thread stopping correctly, false otherwise
*/
bool StopDBus();
/**
* Dispatch an event to the DBus thread
*
* @param event An nsIRunnable to run in the DBus thread
* @return NS_OK on success, or an error code otherwise
*/
nsresult
DispatchToDBusThread(nsIRunnable* event);
}
}
#endif