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
Merge branch 'dev-fix_mailbox_clear' into 'master'
[simgrid.git]
/
src
/
kernel
/
activity
/
MailboxImpl.cpp
diff --git
a/src/kernel/activity/MailboxImpl.cpp
b/src/kernel/activity/MailboxImpl.cpp
index
88b2a08
..
7ee160c
100644
(file)
--- a/
src/kernel/activity/MailboxImpl.cpp
+++ b/
src/kernel/activity/MailboxImpl.cpp
@@
-21,7
+21,7
@@
unsigned MailboxImpl::next_id_ = 0;
MailboxImpl::~MailboxImpl()
{
MailboxImpl::~MailboxImpl()
{
- clear();
+ clear(
false
);
set_receiver(nullptr);
}
set_receiver(nullptr);
}
@@
-68,13
+68,14
@@
void MailboxImpl::remove(const CommImplPtr& comm)
/** @brief Removes all communication activities from a mailbox
*/
/** @brief Removes all communication activities from a mailbox
*/
-void MailboxImpl::clear()
+void MailboxImpl::clear(
bool do_post
)
{
// CommImpl::cancel() will remove the comm from the mailbox..
for (auto comm : done_comm_queue_) {
comm->cancel();
comm->set_state(State::FAILED);
{
// CommImpl::cancel() will remove the comm from the mailbox..
for (auto comm : done_comm_queue_) {
comm->cancel();
comm->set_state(State::FAILED);
- comm->post();
+ if(do_post)
+ comm->post();
}
done_comm_queue_.clear();
}
done_comm_queue_.clear();
@@
-83,7
+84,8
@@
void MailboxImpl::clear()
if (comm->get_state() == State::WAITING && not comm->is_detached()) {
comm->cancel();
comm->set_state(State::FAILED);
if (comm->get_state() == State::WAITING && not comm->is_detached()) {
comm->cancel();
comm->set_state(State::FAILED);
- comm->post();
+ if(do_post)
+ comm->post();
} else
comm_queue_.pop_back();
}
} else
comm_queue_.pop_back();
}