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
Define and use SwappedContext::verify_previous_context().
[simgrid.git]
/
src
/
kernel
/
context
/
ContextSwapped.hpp
diff --git
a/src/kernel/context/ContextSwapped.hpp
b/src/kernel/context/ContextSwapped.hpp
index
c495b34
..
cabea51
100644
(file)
--- a/
src/kernel/context/ContextSwapped.hpp
+++ b/
src/kernel/context/ContextSwapped.hpp
@@
-57,6
+57,10
@@
public:
bool asan_stop_ = false;
#endif
bool asan_stop_ = false;
#endif
+protected:
+ // With ASan, after a context switch, check that the originating context is the expected one (see BoostContext)
+ void verify_previous_context(const SwappedContext* context) const;
+
private:
static thread_local SwappedContext* worker_context_;
private:
static thread_local SwappedContext* worker_context_;
@@
-68,6
+72,13
@@
private:
#endif
};
#endif
};
+inline void SwappedContext::verify_previous_context(XBT_ATTRIB_UNUSED const SwappedContext* context) const
+{
+#if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT
+ xbt_assert(this->asan_ctx_ == context);
+#endif
+}
+
} // namespace context
} // namespace kernel
} // namespace simgrid
} // namespace context
} // namespace kernel
} // namespace simgrid