2013-12-10 00:55:13 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#include "util/thread.h"
|
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
#if defined(LEAN_USE_BOOST)
|
2014-09-23 15:00:21 +00:00
|
|
|
static boost::thread::attributes * g_thread_attributes = nullptr;
|
|
|
|
void initialize_thread() {
|
|
|
|
g_thread_attributes = new boost::thread::attributes();
|
|
|
|
g_thread_attributes->set_stack_size(8192*1024); // 8Mb
|
|
|
|
}
|
|
|
|
void finalize_thread() {
|
|
|
|
delete g_thread_attributes;
|
|
|
|
}
|
2013-12-10 00:55:13 +00:00
|
|
|
void set_thread_stack_size(size_t sz) {
|
2014-09-23 15:00:21 +00:00
|
|
|
g_thread_attributes->set_stack_size(sz);
|
2013-12-10 00:55:13 +00:00
|
|
|
}
|
|
|
|
boost::thread::attributes const & get_thread_attributes() {
|
2014-09-23 15:00:21 +00:00
|
|
|
return *g_thread_attributes;
|
2013-12-10 00:55:13 +00:00
|
|
|
}
|
2014-09-23 15:00:21 +00:00
|
|
|
#else
|
|
|
|
void initialize_thread() {}
|
|
|
|
void finalize_thread() {}
|
2013-12-10 00:55:13 +00:00
|
|
|
#endif
|
|
|
|
}
|