30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
From 4655a4fad848d2d844c19e375d34e0bf3a6228dc Mon Sep 17 00:00:00 2001
|
|
From: markeryang <yanglongkang@huawei.com>
|
|
Date: Fri, 13 Aug 2021 18:33:22 +0800
|
|
Subject: [PATCH] fix error PTHREAD_STACK_MIN
|
|
|
|
Signed-off-by: markeryang <yanglongkang@huawei.com>
|
|
Signed-off-by: lxk <lixiaokeng@huawei.com>
|
|
---
|
|
src/boost/boost/thread/pthread/thread_data.hpp | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/boost/boost/thread/pthread/thread_data.hpp b/src/boost/boost/thread/pthread/thread_data.hpp
|
|
index aefbeb43..9e459b1f 100644
|
|
--- a/src/boost/boost/thread/pthread/thread_data.hpp
|
|
+++ b/src/boost/boost/thread/pthread/thread_data.hpp
|
|
@@ -57,8 +57,9 @@ namespace boost
|
|
#else
|
|
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
|
|
#endif
|
|
-#if PTHREAD_STACK_MIN > 0
|
|
- if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
|
|
+#ifdef PTHREAD_STACK_MIN
|
|
+ if (PTHREAD_STACK_MIN > 0 && size < (std::size_t)PTHREAD_STACK_MIN)
|
|
+ size = (std::size_t)PTHREAD_STACK_MIN;
|
|
#endif
|
|
size = ((size+page_size-1)/page_size)*page_size;
|
|
int res = pthread_attr_setstacksize(&val_, size);
|
|
--
|
|
2.23.0
|