From 72d06b1a38c5b06c80a382852bcee32252aa7611 Mon Sep 17 00:00:00 2001 From: Ting-Yuan Huang Date: Tue, 20 May 2014 18:07:22 +0800 Subject: [PATCH] Bug 1006695 - Mark workers in thread pool to be known by Nuwa. r=luke They will be recreated in the spawned process. --- js/src/vm/ThreadPool.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/src/vm/ThreadPool.cpp b/js/src/vm/ThreadPool.cpp index 0e57b88ba1f..7a19b531eee 100644 --- a/js/src/vm/ThreadPool.cpp +++ b/js/src/vm/ThreadPool.cpp @@ -150,10 +150,25 @@ ThreadPoolWorker::start() #endif } +#ifdef MOZ_NUWA_PROCESS +extern "C" { +MFBT_API bool IsNuwaProcess(); +MFBT_API void NuwaMarkCurrentThread(void (*recreate)(void *), void *arg); +} +#endif + void ThreadPoolWorker::HelperThreadMain(void *arg) { ThreadPoolWorker *worker = (ThreadPoolWorker*) arg; + +#ifdef MOZ_NUWA_PROCESS + if (IsNuwaProcess()) { + JS_ASSERT(NuwaMarkCurrentThread != nullptr); + NuwaMarkCurrentThread(nullptr, nullptr); + } +#endif + worker->helperLoop(); }