mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Bug 803471 - Part 1a - Enable Binder ThreadPool. r=mwu
This commit is contained in:
parent
f70a443dfa
commit
12c26d0257
@ -37,6 +37,10 @@
|
||||
|
||||
#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
# include <binder/ProcessState.h>
|
||||
#endif
|
||||
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
static void Output(const char *fmt, ... )
|
||||
@ -168,6 +172,14 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
char exePath[MAXPATHLEN];
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
// This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
|
||||
// receive binder calls, though not necessary to send binder calls.
|
||||
// ProcessState::Self() also needs to be called once on the main thread to
|
||||
// register the main thread with the binder driver.
|
||||
android::ProcessState::self()->startThreadPool();
|
||||
#endif
|
||||
|
||||
nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
|
||||
if (NS_FAILED(rv)) {
|
||||
Output("Couldn't calculate the application directory.\n");
|
||||
|
@ -22,9 +22,21 @@
|
||||
#include "nsSetDllDirectory.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
# include <binder/ProcessState.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
// This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
|
||||
// receive binder calls, though not necessary to send binder calls.
|
||||
// ProcessState::Self() also needs to be called once on the main thread to
|
||||
// register the main thread with the binder driver.
|
||||
android::ProcessState::self()->startThreadPool();
|
||||
#endif
|
||||
|
||||
#if defined(XP_WIN) && defined(DEBUG_bent)
|
||||
MessageBox(NULL, L"Hi", L"Hi", MB_OK);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user