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())