-/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
{
/* If the user provided a function for the process then use it */
if (has_code()) {
- if (smx_context_stack_size_was_set)
- xbt_os_thread_setstacksize(smx_context_stack_size);
- if (smx_context_guard_size_was_set)
- xbt_os_thread_setguardsize(smx_context_guard_size);
-
/* create and start the process */
- this->thread_ = xbt_os_thread_create(ThreadContext::wrapper, this);
+ this->thread_ = new std::thread(ThreadContext::wrapper, this);
/* wait the starting of the newly created process */
this->end_.acquire();
}
ThreadContext::~ThreadContext()
{
if (this->thread_) /* If there is a thread (maestro don't have any), wait for its termination */
- xbt_os_thread_join(this->thread_, nullptr);
+ thread_->join();
}
void *ThreadContext::wrapper(void *param)