Bug 1476405: Part 2b - Use default thread size from nsIThreadManager in Linux PlatformThreads. r?jld draft
authorKris Maglione <maglione.k@gmail.com>
Fri, 20 Jul 2018 13:20:42 -0700
changeset 821041 68935ef593163b30172950789be82ec5730bc6c9
parent 821040 b1f0333414b0d716e874efb5e7916227d42b62b4
child 821042 7922493a0d83901a17f9eb298de8c2f8050d8f3c
push id116998
push usermaglione.k@gmail.com
push dateFri, 20 Jul 2018 20:53:25 +0000
reviewersjld
bugs1476405
milestone63.0a1
Bug 1476405: Part 2b - Use default thread size from nsIThreadManager in Linux PlatformThreads. r?jld MozReview-Commit-ID: 4Mod1IdzJBw
ipc/chromium/src/base/platform_thread_posix.cc
--- a/ipc/chromium/src/base/platform_thread_posix.cc
+++ b/ipc/chromium/src/base/platform_thread_posix.cc
@@ -119,18 +119,19 @@ bool CreateThread(size_t stack_size, boo
   pthread_attr_init(&attributes);
 
   // Pthreads are joinable by default, so only specify the detached attribute if
   // the thread should be non-joinable.
   if (!joinable) {
     pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED);
   }
 
-  if (stack_size > 0)
-    pthread_attr_setstacksize(&attributes, stack_size);
+  if (stack_size == 0)
+    stack_size = nsIThreadManager::DEFAULT_STACK_SIZE;
+  pthread_attr_setstacksize(&attributes, stack_size);
 
   success = !pthread_create(thread_handle, &attributes, ThreadFunc, delegate);
 
   pthread_attr_destroy(&attributes);
   return success;
 }
 
 }  // anonymous namespace