Bug 989509 - Part 1: js/ (r=luke)
authorShu-yu Guo <shu@rfrn.org>
Thu, 03 Apr 2014 19:29:40 -0700
changeset 195553 0713dda3631803a75d3b5de46e85b8136ef8d785
parent 195552 1e38b4aa888918c67c71de6e2dd3661f76b88ec5
child 195554 f3ef20919f35838c16189f8f20c427ccdcc86fed
push idunknown
push userunknown
push dateunknown
reviewersluke
bugs989509
milestone31.0a1
Bug 989509 - Part 1: js/ (r=luke)
js/src/jsworkers.cpp
js/src/shell/js.cpp
js/src/vm/ThreadPool.cpp
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -426,17 +426,17 @@ GlobalWorkerThreadState::ensureInitializ
     if (!threads)
         return false;
 
     for (size_t i = 0; i < threadCount; i++) {
         WorkerThread &helper = threads[i];
         helper.threadData.construct(static_cast<JSRuntime *>(nullptr));
         helper.thread = PR_CreateThread(PR_USER_THREAD,
                                         WorkerThread::ThreadMain, &helper,
-                                        PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, PR_JOINABLE_THREAD, WORKER_STACK_SIZE);
+                                        PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, WORKER_STACK_SIZE);
         if (!helper.thread || !helper.threadData.ref().init()) {
             for (size_t j = 0; j < threadCount; j++)
                 threads[j].destroy();
             js_free(threads);
             threads = nullptr;
             return false;
         }
     }
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -2911,17 +2911,17 @@ EvalInWorker(JSContext *cx, unsigned arg
         return false;
     PodCopy(chars, str->chars(), str->length());
 
     WorkerInput *input = js_new<WorkerInput>(cx->runtime(), chars, str->length());
     if (!input)
         return false;
 
     PRThread *thread = PR_CreateThread(PR_USER_THREAD, WorkerMain, input,
-                                       PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, PR_JOINABLE_THREAD, 0);
+                                       PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
     if (!thread || !workerThreads.append(thread))
         return false;
 
     return true;
 }
 #endif
 
 static bool
@@ -3212,17 +3212,17 @@ ScheduleWatchdog(JSRuntime *rt, double t
     int64_t timeout = PRMJ_Now() + interval;
     PR_Lock(gWatchdogLock);
     if (!gWatchdogThread) {
         JS_ASSERT(!gWatchdogHasTimeout);
         gWatchdogThread = PR_CreateThread(PR_USER_THREAD,
                                           WatchdogMain,
                                           rt,
                                           PR_PRIORITY_NORMAL,
-                                          PR_LOCAL_THREAD,
+                                          PR_GLOBAL_THREAD,
                                           PR_JOINABLE_THREAD,
                                           0);
         if (!gWatchdogThread) {
             PR_Unlock(gWatchdogLock);
             return false;
         }
     } else if (!gWatchdogHasTimeout || IsBefore(timeout, gWatchdogTimeout)) {
          PR_NotifyCondVar(gWatchdogWakeup);
--- a/js/src/vm/ThreadPool.cpp
+++ b/js/src/vm/ThreadPool.cpp
@@ -132,17 +132,17 @@ ThreadPoolWorker::start()
 
     MOZ_ASSERT(state_ == CREATED);
 
     // Set state to active now, *before* the thread starts:
     state_ = ACTIVE;
 
     if (!PR_CreateThread(PR_USER_THREAD,
                          HelperThreadMain, this,
-                         PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
+                         PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
                          PR_UNJOINABLE_THREAD,
                          WORKER_THREAD_STACK_SIZE))
     {
         // If the thread failed to start, call it TERMINATED.
         state_ = TERMINATED;
         return false;
     }
 
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1053,17 +1053,17 @@ class Watchdog
         mWakeup = PR_NewCondVar(mLock);
         if (!mWakeup)
             NS_RUNTIMEABORT("PR_NewCondVar failed.");
 
         {
             AutoLockWatchdog lock(this);
 
             mThread = PR_CreateThread(PR_USER_THREAD, WatchdogMain, this,
-                                      PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
+                                      PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
                                       PR_UNJOINABLE_THREAD, 0);
             if (!mThread)
                 NS_RUNTIMEABORT("PR_CreateThread failed!");
 
             // WatchdogMain acquires the lock and then asserts mInitialized. So
             // make sure to set mInitialized before releasing the lock here so
             // that it's atomic with the creation of the thread.
             mInitialized = true;