Merge remote-tracking branch 'origin/master' into segfaultfix
authorKshitij Bansal <kshitij@cs.nyu.edu>
Thu, 10 Jul 2014 20:20:42 +0000 (16:20 -0400)
committerKshitij Bansal <kshitij@cs.nyu.edu>
Thu, 10 Jul 2014 20:20:42 +0000 (16:20 -0400)
1  2 
src/main/portfolio.cpp
src/theory/bv/bv_subtheory_algebraic.cpp
src/theory/bv/bv_subtheory_algebraic.h

index 8bfbeff7c1dda3f39a2528f99efd2dc301937532,757b6cd3ce88cdbe2eb100cffbc10cc801f783cd..abe27eb06de2536133fcd7f3b02c4272afffefb7
@@@ -74,21 -74,26 +75,35 @@@ std::pair<int, S> runPortfolio(int numT
  
    for(int t = 0; t < numThreads; ++t) {
  
+ #if BOOST_HAS_THREAD_ATTR
      boost::thread::attributes attrs;
-     attrs.set_stack_size(256 * 1024 * 1024);
  
-     threads[t] = 
+     if(stackSize > 0) {
+       attrs.set_stack_size(stackSize);
+     }
+     threads[t] =
        boost::thread(attrs, boost::bind(runThread<S>, t, threadFns[t],
+                                        boost::ref(threads_returnValue[t]) ) );
+ #else /* BOOST_HAS_THREAD_ATTR */
+     if(stackSize > 0) {
+       throw OptionException("cannot specify a stack size for worker threads; requires CVC4 to be built with Boost thread library >= 1.50.0");
+     }
+     threads[t] =
+       boost::thread(boost::bind(runThread<S>, t, threadFns[t],
                                  boost::ref(threads_returnValue[t]) ) );
 +
+ #endif /* BOOST_HAS_THREAD_ATTR */
 +    if(Chat.isOn()) {
 +      void *stackaddr;
 +      size_t stacksize;
 +      pthread_attr_t attr;
 +      pthread_getattr_np(threads[t].native_handle(), &attr);
 +      pthread_attr_getstack(&attr, &stackaddr, &stacksize);
 +      Chat() << "Created worker thread " << t << " with stack size " << stacksize << std::endl;
 +    }
    }
  
    if(not driverFn.empty())