Bug 1006695 - Mark JS worker threads to be known by Nuwa. r=luke

They will be recreated in the spawned process.
This commit is contained in:
Ting-Yuan Huang 2014-05-20 18:06:14 +08:00
parent 33f06c9462
commit 4c6d6c9b03

View File

@ -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<WorkerThread *>(arg)->threadLoop();
}