From b76ce542def7d7b35a47fbe476dadb442fc6a403 Mon Sep 17 00:00:00 2001 From: Ting-Yuan Huang Date: Tue, 20 May 2014 18:06:14 +0800 Subject: [PATCH] Bug 1006695 - Mark JS worker threads to be known by Nuwa. r=luke They will be recreated in the spawned process. --- js/src/jsworkers.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/src/jsworkers.cpp b/js/src/jsworkers.cpp index b370cff2e2c..727f073cd4d 100644 --- a/js/src/jsworkers.cpp +++ b/js/src/jsworkers.cpp @@ -719,11 +719,26 @@ WorkerThread::destroy() threadData.destroy(); } +#ifdef MOZ_NUWA_PROCESS +extern "C" { +MFBT_API bool IsNuwaProcess(); +MFBT_API void NuwaMarkCurrentThread(void (*recreate)(void *), void *arg); +} +#endif + /* static */ void WorkerThread::ThreadMain(void *arg) { PR_SetCurrentThreadName("Analysis Helper"); + +#ifdef MOZ_NUWA_PROCESS + if (IsNuwaProcess()) { + JS_ASSERT(NuwaMarkCurrentThread != nullptr); + NuwaMarkCurrentThread(nullptr, nullptr); + } +#endif + static_cast(arg)->threadLoop(); }