Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6_0_X][TIMOB-23901] Android: Fix KrollRuntime init on main thread #8427

Merged
merged 2 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,12 @@ private static void syncInit()
synchronized (runtimeState) {
if (runtimeState == State.DISPOSED) {
instance.initLatch = new CountDownLatch(1);
instance.handler.sendEmptyMessage(MSG_INIT);

if (instance.isRuntimeThread()) {
instance.doInit();
} else {
instance.handler.sendEmptyMessage(MSG_INIT);
}

} else if (runtimeState == State.RELEASED) {
runtimeState = State.RELAUNCHED;
Expand Down
4 changes: 2 additions & 2 deletions android/runtime/v8/src/native/V8Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ JNIEXPORT jboolean JNICALL Java_org_appcelerator_kroll_runtime_v8_V8Runtime_nati
//}

// FIXME What is a good value to use here? We're basically giving it 100 ms to run right now
double deadline_in_ms = (V8Runtime::platform->MonotonicallyIncreasingTime() * static_cast<double>(1000)) + 100.0;
return V8Runtime::v8_isolate->IdleNotificationDeadline(deadline_in_ms);
double deadline_in_s = V8Runtime::platform->MonotonicallyIncreasingTime() + 0.1;
return V8Runtime::v8_isolate->IdleNotificationDeadline(deadline_in_s);
}

/*
Expand Down