Permalink
Browse files

Update oxt::thread to the boost::thread 1.51.0 API

  • Loading branch information...
1 parent c6fc7bf commit 178f1d79cf930967ab6ebc300bb2a9236965a7cd @FooBarWidget FooBarWidget committed Nov 1, 2012
Showing with 11 additions and 5 deletions.
  1. +11 −5 ext/oxt/thread.hpp
View
16 ext/oxt/thread.hpp
@@ -70,11 +70,15 @@ class thread: public boost::thread {
* @throws boost::thread_resource_error Something went wrong during
* creation of the thread.
*/
- explicit thread(const boost::function<void ()> func, const std::string &name = std::string(), unsigned int stack_size = 0) {
+ explicit thread(const boost::function<void ()> func,
+ const std::string &name = std::string(),
+ unsigned int stack_size = 0)
+ : boost::thread()
+ {
context = thread_local_context::make_shared_ptr();
context->thread_name = make_thread_name(name);
- set_thread_main_function(boost::bind(thread_main, func, context));
-
+ thread_info = make_thread_info(boost::bind(thread_main, func, context));
+
unsigned long min_stack_size;
bool stack_min_size_defined;
bool round_stack_size;
@@ -114,8 +118,10 @@ class thread: public boost::thread {
stack_size = stack_size - (stack_size % page_size) + page_size;
}
}
-
- start_thread(stack_size);
+
+ attributes attrs;
+ attrs.set_stack_size(stack_size);
+ start_thread(attrs);
}
/**

0 comments on commit 178f1d7

Please sign in to comment.