while ((process = (smx_process_t) xbt_swag_extract(simix_global->process_to_destroy))) {
XBT_DEBUG("Getting rid of %p",process);
-
delete process->context;
-
- /* Free the exception allocated at creation time */
- free(process->running_ctx);
xbt_dict_free(&process->properties);
-
xbt_fifo_free(process->comms);
-
xbt_dynar_free(&process->on_exit);
-
delete process;
}
}
maestro->ppid = -1;
maestro->name = "";
maestro->data = nullptr;
- maestro->running_ctx = (xbt_running_ctx_t*) xbt_malloc0(sizeof(xbt_running_ctx_t));
- XBT_RUNNING_CTX_INITIALIZE(maestro->running_ctx);
if (!code) {
maestro->context = SIMIX_context_new(std::function<void()>(), nullptr, maestro);
std::move(code),
simix_global->cleanup_process_function, process);
- process->running_ctx = (xbt_running_ctx_t*) xbt_malloc0(sizeof(xbt_running_ctx_t));
- XBT_RUNNING_CTX_INITIALIZE(process->running_ctx);
-
- if(MC_is_active()){
- MC_ignore_heap(process->running_ctx, sizeof(*process->running_ctx));
- }
-
/* Add properties */
process->properties = properties;
process->context = simix_global->context_factory->attach(
simix_global->cleanup_process_function, process);
- process->running_ctx = (xbt_running_ctx_t*) xbt_malloc0(sizeof(xbt_running_ctx_t));
- XBT_RUNNING_CTX_INITIALIZE(process->running_ctx);
-
- if(MC_is_active()){
- MC_ignore_heap(process->running_ctx, sizeof(*process->running_ctx));
- }
-
/* Add properties */
process->properties = properties;
process->context->iwannadie = 1;
process->blocked = 0;
process->suspended = 0;
- process->doexception = 0;
+ process->exception = nullptr;
/* destroy the blocking synchro if any */
if (process->waiting_synchro) {
if (self->suspended) {
XBT_DEBUG("Hey! I'm suspended.");
- xbt_assert(!self->doexception, "Gasp! This exception may be lost by subsequent calls.");
+ xbt_assert(self->exception != nullptr, "Gasp! This exception may be lost by subsequent calls.");
self->suspended = 0;
SIMIX_process_suspend(self, self);
}
- if (self->doexception) {
+ if (self->exception != nullptr) {
XBT_DEBUG("Wait, maestro left me an exception");
- self->doexception = 0;
- RETHROW;
+ std::exception_ptr exception = std::move(self->exception);
+ self->exception = nullptr;
+ std::rethrow_exception(std::move(exception));
}
if(SMPI_switch_data_segment && self->segment_index != -1){
}
}
-/* callback: context fetching */
-xbt_running_ctx_t *SIMIX_process_get_running_context(void)
-{
- smx_process_t process = SIMIX_process_self();
- if (process)
- return process->running_ctx;
- else
- return nullptr;
-}
-
/* callback: termination */
void SIMIX_process_exception_terminate(xbt_ex_t * e)
{