about summary refs log tree commit diff
path: root/src/rt/sync/rust_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/sync/rust_thread.cpp')
-rw-r--r--src/rt/sync/rust_thread.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rt/sync/rust_thread.cpp b/src/rt/sync/rust_thread.cpp
index 99613da9b0d..824642fc435 100644
--- a/src/rt/sync/rust_thread.cpp
+++ b/src/rt/sync/rust_thread.cpp
@@ -10,6 +10,7 @@
 
 
 #include "rust_thread.h"
+#include <limits.h>
 
 const size_t default_stack_sz = 1024*1024;
 
@@ -41,6 +42,8 @@ rust_thread::start() {
 #if defined(__WIN32__)
    thread = CreateThread(NULL, stack_sz, rust_thread_start, this, 0, NULL);
 #else
+   // PTHREAD_STACK_MIN of some system is larger than default size
+   // so we check stack_sz to prevent assertion failure.
    if (stack_sz < PTHREAD_STACK_MIN) {
       stack_sz = PTHREAD_STACK_MIN;
    }