- BoostContext::stop();
- this->suspend();
-}
-
-// BoostParallelContext
-
-#if HAVE_THREAD_CONTEXTS
-
-void BoostParallelContext::suspend()
-{
- smx_process_t next_work = (smx_process_t) xbt_parmap_next(parmap_);
- BoostParallelContext* next_context = nullptr;
-
- if (next_work != nullptr) {
- XBT_DEBUG("Run next process");
- next_context = static_cast<BoostParallelContext*>(next_work->context);
- }
- else {
- XBT_DEBUG("No more processes to run");
- uintptr_t worker_id =
- (uintptr_t) xbt_os_thread_get_specific(worker_id_key_);
- next_context = static_cast<BoostParallelContext*>(
- workers_context_[worker_id]);
- }
-
- SIMIX_context_set_current((smx_context_t) next_context);
-#if HAVE_BOOST_CONTEXTS == 1
- boost::context::jump_fcontext(
- this->fc_, next_context->fc_, (intptr_t)next_context);
-#else
- boost::context::jump_fcontext(
- &this->fc_, next_context->fc_, (intptr_t)next_context);
-#endif
-}
-
-void BoostParallelContext::stop()
-{
- BoostContext::stop();
- this->suspend();
-}
-
-void BoostParallelContext::resume()
-{
- uintptr_t worker_id = __sync_fetch_and_add(&threads_working_, 1);
- xbt_os_thread_set_specific(worker_id_key_, (void*) worker_id);
-
- BoostParallelContext* worker_context =
- static_cast<BoostParallelContext*>(SIMIX_context_self());
- workers_context_[worker_id] = worker_context;
-
- SIMIX_context_set_current(this);
-#if HAVE_BOOST_CONTEXTS == 1
- boost::context::jump_fcontext(
- worker_context->fc_, this->fc_, (intptr_t) this);
+ BoostContext* to = static_cast<BoostContext*>(to_);
+#if BOOST_VERSION < 105600
+ boost::context::jump_fcontext(this->fc_, to->fc_, reinterpret_cast<intptr_t>(to));
+#elif BOOST_VERSION < 106100
+ boost::context::jump_fcontext(&this->fc_, to->fc_, reinterpret_cast<intptr_t>(to));