/* 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. */
/* 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. */
this->uc_.uc_link = nullptr;
this->uc_.uc_stack.ss_sp = sg_makecontext_stack_addr(this->stack_);
this->uc_.uc_stack.ss_size = sg_makecontext_stack_size(smx_context_usable_stack_size);
this->uc_.uc_link = nullptr;
this->uc_.uc_stack.ss_sp = sg_makecontext_stack_addr(this->stack_);
this->uc_.uc_stack.ss_size = sg_makecontext_stack_size(smx_context_usable_stack_size);
* Makecontext expects integer arguments, we the context variable is decomposed into a serie of integers and each
* integer is passed as argument to makecontext.
*/
* Makecontext expects integer arguments, we the context variable is decomposed into a serie of integers and each
* integer is passed as argument to makecontext.
*/
-void UContext::makecontext(ucontext_t* ucp, void (*func)(int, int), UContext* arg)
+void UContext::make_ctx(ucontext_t* ucp, void (*func)(int, int), UContext* arg)
{
int ctx_addr[CTX_ADDR_LEN]{};
memcpy(ctx_addr, &arg, sizeof arg);
{
int ctx_addr[CTX_ADDR_LEN]{};
memcpy(ctx_addr, &arg, sizeof arg);
- ::makecontext(ucp, (void (*)())func, 2, ctx_addr[0], ctx_addr[1]);
+ makecontext(ucp, (void (*)())func, 2, ctx_addr[0], ctx_addr[1]);
xbt_os_thread_key_t ParallelUContext::worker_id_key_; /* thread-specific storage for the thread id */
std::vector<ParallelUContext*> ParallelUContext::workers_context_; /* space to save the worker's context
* in each thread */
xbt_os_thread_key_t ParallelUContext::worker_id_key_; /* thread-specific storage for the thread id */
std::vector<ParallelUContext*> ParallelUContext::workers_context_; /* space to save the worker's context
* in each thread */
// Store the number of my containing body in os-thread-specific area :
xbt_os_thread_set_specific(worker_id_key_, reinterpret_cast<void*>(worker_id));
// Get my current soul:
// Store the number of my containing body in os-thread-specific area :
xbt_os_thread_set_specific(worker_id_key_, reinterpret_cast<void*>(worker_id));
// Get my current soul: