A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kill a parameter that was always nullptr
[simgrid.git]
/
src
/
kernel
/
context
/
ContextThread.cpp
diff --git
a/src/kernel/context/ContextThread.cpp
b/src/kernel/context/ContextThread.cpp
index
eb9b4bd
..
c6901c9
100644
(file)
--- a/
src/kernel/context/ContextThread.cpp
+++ b/
src/kernel/context/ContextThread.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009-202
2
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-202
3
. 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. */
/* 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. */
@@
-18,9
+18,7
@@
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context);
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ker_context);
-namespace simgrid {
-namespace kernel {
-namespace context {
+namespace simgrid::kernel::context {
// ThreadContextFactory
// ThreadContextFactory
@@
-86,9
+84,7
@@
void ThreadContext::wrapper(ThreadContext* context)
{
Context::set_current(context);
{
Context::set_current(context);
-#ifndef WIN32
- install_sigsegv_stack(nullptr, true);
-#endif
+ install_sigsegv_stack(true);
// Tell the caller (normally the maestro) we are starting, and wait for its green light
context->end_.release();
context->start();
// Tell the caller (normally the maestro) we are starting, and wait for its green light
context->end_.release();
context->start();
@@
-107,9
+103,7
@@
void ThreadContext::wrapper(ThreadContext* context)
// Signal to the caller (normally the maestro) that we have finished:
context->yield();
// Signal to the caller (normally the maestro) that we have finished:
context->yield();
-#ifndef WIN32
- install_sigsegv_stack(nullptr, false);
-#endif
+ install_sigsegv_stack(false);
XBT_DEBUG("Terminating");
Context::set_current(nullptr);
}
XBT_DEBUG("Terminating");
Context::set_current(nullptr);
}
@@
-166,7
+160,7
@@
void ThreadContext::attach_stop()
void SerialThreadContext::run_all(std::vector<actor::ActorImpl*> const& actors_list)
{
void SerialThreadContext::run_all(std::vector<actor::ActorImpl*> const& actors_list)
{
- for (
smx_actor_t const&
actor : actors_list) {
+ for (
auto const*
actor : actors_list) {
XBT_DEBUG("Handling %p", actor);
auto* context = static_cast<ThreadContext*>(actor->context_.get());
context->release();
XBT_DEBUG("Handling %p", actor);
auto* context = static_cast<ThreadContext*>(actor->context_.get());
context->release();
@@
-191,10
+185,10
@@
void ParallelThreadContext::finalize()
void ParallelThreadContext::run_all(std::vector<actor::ActorImpl*> const& actors_list)
{
void ParallelThreadContext::run_all(std::vector<actor::ActorImpl*> const& actors_list)
{
- for (
smx_actor_t const&
actor : actors_list)
+ for (
auto const*
actor : actors_list)
static_cast<ThreadContext*>(actor->context_.get())->release();
static_cast<ThreadContext*>(actor->context_.get())->release();
- for (
smx_actor_t const&
actor : actors_list)
+ for (
auto const*
actor : actors_list)
static_cast<ThreadContext*>(actor->context_.get())->wait();
}
static_cast<ThreadContext*>(actor->context_.get())->wait();
}
@@
-215,6
+209,4
@@
XBT_PRIVATE ContextFactory* thread_factory()
XBT_VERB("Activating thread context factory");
return new ThreadContextFactory();
}
XBT_VERB("Activating thread context factory");
return new ThreadContextFactory();
}
-} // namespace context
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::context