From 5e20812d38ef489047848199ca6b9d82331a5b09 Mon Sep 17 00:00:00 2001 From: Ting-Yuan Huang Date: Wed, 14 May 2014 00:32:00 +0200 Subject: [PATCH] Bug 1006695 - Mark JS worker threads to be known by Nuwa. r=khuey They will be recreated in the spawned process. --- js/src/jsworkers.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/src/jsworkers.cpp b/js/src/jsworkers.cpp index b370cff2e2ca..e4f3313188a6 100644 --- a/js/src/jsworkers.cpp +++ b/js/src/jsworkers.cpp @@ -23,6 +23,10 @@ #include "jsobjinlines.h" #include "jsscriptinlines.h" +#ifdef MOZ_NUWA_PROCESS +# include "ipc/Nuwa.h" +#endif + using namespace js; using mozilla::ArrayLength; @@ -724,6 +728,14 @@ 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(); }