#include "src/kernel/context/Context.hpp"
#include "src/simix/smx_private.hpp"
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
+
/**
* @brief creates a new context for a user level process
* @param code a main function
this->process_->suspended_ = 0;
this->iwannadie = false;
- if (not this->process_->finished_) // It seems that we sometimes try to destroy an actor twice
- simgrid::simix::simcall([this] { SIMIX_process_cleanup(this->process_); });
+ simgrid::simix::simcall([this] { SIMIX_process_cleanup(this->process_); });
this->iwannadie = true;
}
#include "ContextBoost.hpp"
#include "context_private.hpp"
+#include "simgrid/Exception.hpp"
#include "src/simix/smx_private.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
#endif
try {
(*context)();
- context->Context::stop();
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
+ } catch (simgrid::HostFailureException const&) {
+ XBT_DEBUG("Caught an HostFailureException");
}
+ context->Context::stop();
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
#include "ContextRaw.hpp"
#include "context_private.hpp"
#include "mc/mc.h"
+#include "simgrid/Exception.hpp"
#include "src/simix/smx_private.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
try {
(*context)();
- context->Context::stop();
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
+ } catch (simgrid::HostFailureException const&) {
+ XBT_DEBUG("Caught an HostFailureException");
}
+ context->Context::stop();
+
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}
/* 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. */
-#include <utility>
-#include <functional>
+#include "src/kernel/context/ContextThread.hpp"
+#include "simgrid/Exception.hpp"
#include "src/internal_config.h" /* loads context system definitions */
#include "src/simix/smx_private.hpp"
#include "src/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */
#include "xbt/function_types.h"
#include "xbt/xbt_os_thread.h"
-#include "src/kernel/context/ContextThread.hpp"
+#include <functional>
+#include <utility>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
} catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
xbt_assert(not context->is_maestro(), "I'm not supposed to be maestro here.");
+ } catch (simgrid::HostFailureException const&) {
+ XBT_DEBUG("Caught an HostFailureException");
}
+ if (not context->is_maestro()) // really?
+ context->Context::stop();
// Signal to the caller (normally the maestro) that we have finished:
context->yield();
-/* Copyright (c) 2009-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2009-2018. 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. */
#ifndef SIMGRID_SIMIX_THREAD_CONTEXT_HPP
#define SIMGRID_SIMIX_THREAD_CONTEXT_HPP
-#include <simgrid/simix.hpp>
-
+#include "simgrid/simix.hpp"
+#include "src/kernel/context/Context.hpp"
+#include "xbt/xbt_os_thread.h"
namespace simgrid {
namespace kernel {
/* \file UContext.cpp Context switching with ucontexts from System V */
-#include "ContextUnix.hpp"
#include "context_private.hpp"
#include "mc/mc.h"
+#include "simgrid/Exception.hpp"
#include "src/mc/mc_ignore.hpp"
#include "src/simix/ActorImpl.hpp"
+#include "ContextUnix.hpp"
+
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
/** Many integers are needed to store a pointer
ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
try {
(*context)();
- context->Context::stop();
} catch (simgrid::kernel::context::Context::StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
+ } catch (simgrid::HostFailureException const&) {
+ XBT_DEBUG("Caught an HostFailureException");
}
+ context->Context::stop();
ASAN_ONLY(context->asan_stop_ = true);
context->suspend();
}