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
comment++ on that code that I barely understand but exhibits bugs
[simgrid.git]
/
src
/
simix
/
ActorImpl.hpp
diff --git
a/src/simix/ActorImpl.hpp
b/src/simix/ActorImpl.hpp
index f2a18a6240b86ec0280828eb33cdf1a53a1de47e..3e0f707c0a9ddb39fb78e62ad3ad1cb6805c9366 100644
(file)
--- a/
src/simix/ActorImpl.hpp
+++ b/
src/simix/ActorImpl.hpp
@@
-79,6
+79,8
@@
public:
{
// inspired from http://www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html
if (process->refcount_.fetch_sub(1, std::memory_order_release) == 1) {
+ // Make sure that any changes done on other threads before their acquire are commited before our delete
+ // http://stackoverflow.com/questions/27751025/why-is-an-acquire-barrier-needed-before-deleting-the-data-in-an-atomically-refer
std::atomic_thread_fence(std::memory_order_acquire);
delete process;
}