Bug 1476405: Part 2b - Use default thread size from nsIThreadManager in Linux PlatformThreads. r?jld
MozReview-Commit-ID: 4Mod1IdzJBw
--- 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