/* rank of the execution thread */
thread_local uintptr_t SwappedContext::worker_id_; /* thread-specific storage for the thread id */
/* rank of the execution thread */
thread_local uintptr_t SwappedContext::worker_id_; /* thread-specific storage for the thread id */
-SwappedContextFactory::SwappedContextFactory(std::string name)
- : ContextFactory(name), parallel_(SIMIX_context_is_parallel())
+SwappedContextFactory::SwappedContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel())
workers_context_.resize(parallel_ ? SIMIX_context_get_nthreads() : 1, nullptr);
}
SwappedContextFactory::~SwappedContextFactory()
{
delete parmap_;
workers_context_.resize(parallel_ ? SIMIX_context_get_nthreads() : 1, nullptr);
}
SwappedContextFactory::~SwappedContextFactory()
{
delete parmap_;
}
SwappedContext::SwappedContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
}
SwappedContext::SwappedContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process,
: Context(std::move(code), cleanup_func, process), factory_(factory)
{
// Save maestro (=context created first) in preparation for run_all
: Context(std::move(code), cleanup_func, process), factory_(factory)
{
// Save maestro (=context created first) in preparation for run_all
#if HAVE_VALGRIND_H
unsigned int valgrind_stack_id =
VALGRIND_STACK_REGISTER(this->stack_, (char*)this->stack_ + smx_context_stack_size);
#if HAVE_VALGRIND_H
unsigned int valgrind_stack_id =
VALGRIND_STACK_REGISTER(this->stack_, (char*)this->stack_ + smx_context_stack_size);