aboutsummaryrefslogtreecommitdiff
path: root/deps/uv/test/test-thread.c
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2017-10-02 19:44:44 -0400
committerRich Trott <rtrott@gmail.com>2017-10-05 12:08:33 -0700
commitfca6c5839a6154275913656dfedb3242959031e3 (patch)
treee1fed70c4929b71306e6a18a92bf5501245a286c /deps/uv/test/test-thread.c
parentb9a55a93c91fb7fd7ac81e182f843f28014179ca (diff)
downloadandroid-node-v8-fca6c5839a6154275913656dfedb3242959031e3.tar.gz
android-node-v8-fca6c5839a6154275913656dfedb3242959031e3.tar.bz2
android-node-v8-fca6c5839a6154275913656dfedb3242959031e3.zip
deps: upgrade libuv to 1.15.0
PR-URL: https://github.com/nodejs/node/pull/15745 Refs: https://github.com/nodejs/node/pull/15380 Refs: https://github.com/nodejs/node/issues/15683 Fixes: https://github.com/nodejs/node/issues/15394 Fixes: https://github.com/nodejs/node/issues/15770 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'deps/uv/test/test-thread.c')
-rw-r--r--deps/uv/test/test-thread.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/deps/uv/test/test-thread.c b/deps/uv/test/test-thread.c
index 10bec3fe6c..b0e87e2081 100644
--- a/deps/uv/test/test-thread.c
+++ b/deps/uv/test/test-thread.c
@@ -211,22 +211,28 @@ TEST_IMPL(thread_local_storage) {
}
-#if defined(__APPLE__)
static void thread_check_stack(void* arg) {
- /* 512KB is the default stack size of threads other than the main thread
- * on OSX. */
+#if defined(__APPLE__)
+ /* 512 kB is the default stack size of threads other than the main thread
+ * on MacOS. */
ASSERT(pthread_get_stacksize_np(pthread_self()) > 512*1024);
-}
+#elif defined(__linux__) && defined(__GLIBC__)
+ struct rlimit lim;
+ size_t stack_size;
+ pthread_attr_t attr;
+ ASSERT(0 == getrlimit(RLIMIT_STACK, &lim));
+ if (lim.rlim_cur == RLIM_INFINITY)
+ lim.rlim_cur = 2 << 20; /* glibc default. */
+ ASSERT(0 == pthread_getattr_np(pthread_self(), &attr));
+ ASSERT(0 == pthread_attr_getstacksize(&attr, &stack_size));
+ ASSERT(stack_size >= lim.rlim_cur);
#endif
+}
TEST_IMPL(thread_stack_size) {
-#if defined(__APPLE__)
uv_thread_t thread;
ASSERT(0 == uv_thread_create(&thread, thread_check_stack, NULL));
ASSERT(0 == uv_thread_join(&thread));
return 0;
-#else
- RETURN_SKIP("OSX only test");
-#endif
}