Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76597 - trunk/libs/thread/test
From: vicente.botet_at_[hidden]
Date: 2012-01-20 13:52:22


Author: viboes
Date: 2012-01-20 13:52:21 EST (Fri, 20 Jan 2012)
New Revision: 76597
URL: http://svn.boost.org/trac/boost/changeset/76597

Log:
Thread: Try to fix min stack size
Text files modified:
   trunk/libs/thread/test/test_2741.cpp | 13 +++++++++----
   1 files changed, 9 insertions(+), 4 deletions(-)

Modified: trunk/libs/thread/test/test_2741.cpp
==============================================================================
--- trunk/libs/thread/test/test_2741.cpp (original)
+++ trunk/libs/thread/test/test_2741.cpp 2012-01-20 13:52:21 EST (Fri, 20 Jan 2012)
@@ -18,7 +18,11 @@
 #include <libs/thread/test/util.inl>
 
 int test_value;
-
+#ifdef PTHREAD_STACK_MIN
+#define MY_PTHREAD_STACK PTHREAD_STACK_MIN
+#else
+#define MY_PTHREAD_STACK 4*0x4000
+#endif
 void simple_thread()
 {
   test_value = 999;
@@ -33,12 +37,13 @@
 #if defined(BOOST_THREAD_PLATFORM_WIN32)
   // ... window version
 #elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
- int k = pthread_attr_setstacksize(h, 4*0x4000);
+
+ int k = pthread_attr_setstacksize(h, MY_PTHREAD_STACK);
   std::cout << k << std::endl;
- BOOST_CHECK(!pthread_attr_setstacksize(h, 4*0x4000));
+ BOOST_CHECK(!pthread_attr_setstacksize(h, MY_PTHREAD_STACK));
   std::size_t res;
   BOOST_CHECK(!pthread_attr_getstacksize(h, &res));
- BOOST_CHECK(res >= (4*0x4000));
+ BOOST_CHECK(res >= (MY_PTHREAD_STACK));
 #else
 #error "Boost thread unavailable on this platform"
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk