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
Fix process_killall. Closes #186.
[simgrid.git]
/
src
/
s4u
/
s4u_comm.cpp
diff --git
a/src/s4u/s4u_comm.cpp
b/src/s4u/s4u_comm.cpp
index
070f7d1
..
abc76c9
100644
(file)
--- a/
src/s4u/s4u_comm.cpp
+++ b/
src/s4u/s4u_comm.cpp
@@
-83,7
+83,10
@@
void Comm::start() {
state_ = started;
}
void Comm::wait() {
state_ = started;
}
void Comm::wait() {
- xbt_assert(state_ == started || state_ == inited);
+ xbt_assert(state_ == started || state_ == inited || state_ == finished);
+
+ if (state_ == finished)
+ return;
if (state_ == started)
simcall_comm_wait(pimpl_, -1/*timeout*/);
if (state_ == started)
simcall_comm_wait(pimpl_, -1/*timeout*/);
@@
-103,7
+106,10
@@
void Comm::wait() {
}
void Comm::wait(double timeout) {
}
void Comm::wait(double timeout) {
- xbt_assert(state_ == started || state_ == inited);
+ xbt_assert(state_ == started || state_ == inited || state_ == finished);
+
+ if (state_ == finished)
+ return;
if (state_ == started) {
simcall_comm_wait(pimpl_, timeout);
if (state_ == started) {
simcall_comm_wait(pimpl_, timeout);
@@
-140,7
+146,8
@@
void Comm::cancel()
commPimpl->cancel();
}
commPimpl->cancel();
}
-bool Comm::test() {
+bool Comm::test()
+{
xbt_assert(state_ == inited || state_ == started || state_ == finished);
if (state_ == finished) {
xbt_assert(state_ == inited || state_ == started || state_ == finished);
if (state_ == finished) {
@@
-158,6
+165,11
@@
bool Comm::test() {
return false;
}
return false;
}
+MailboxPtr Comm::getMailbox()
+{
+ return mailbox_;
+}
+
void intrusive_ptr_release(simgrid::s4u::Comm* c)
{
if (c->refcount_.fetch_sub(1, std::memory_order_release) == 1) {
void intrusive_ptr_release(simgrid::s4u::Comm* c)
{
if (c->refcount_.fetch_sub(1, std::memory_order_release) == 1) {