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
comestics in src/kernel
[simgrid.git]
/
src
/
s4u
/
s4u_Comm.cpp
diff --git
a/src/s4u/s4u_Comm.cpp
b/src/s4u/s4u_Comm.cpp
index
c770e2c
..
7aa422a
100644
(file)
--- a/
src/s4u/s4u_Comm.cpp
+++ b/
src/s4u/s4u_Comm.cpp
@@
-146,7
+146,7
@@
Comm* Comm::wait_for(double timeout)
{
switch (state_) {
case State::FINISHED:
{
switch (state_) {
case State::FINISHED:
-
return this
;
+
break
;
case State::INITED: // It's not started yet. Do it in one simcall
if (src_buff_ != nullptr) {
case State::INITED: // It's not started yet. Do it in one simcall
if (src_buff_ != nullptr) {
@@
-160,13
+160,13
@@
Comm* Comm::wait_for(double timeout)
user_data_, timeout, rate_);
}
state_ = State::FINISHED;
user_data_, timeout, rate_);
}
state_ = State::FINISHED;
-
return this
;
+
break
;
case State::STARTED:
simcall_comm_wait(pimpl_, timeout);
on_completion(Actor::self());
state_ = State::FINISHED;
case State::STARTED:
simcall_comm_wait(pimpl_, timeout);
on_completion(Actor::self());
state_ = State::FINISHED;
-
return this
;
+
break
;
case State::CANCELED:
throw CancelException(XBT_THROW_POINT, "Communication canceled");
case State::CANCELED:
throw CancelException(XBT_THROW_POINT, "Communication canceled");
@@
-222,11
+222,16
@@
bool Comm::test()
return false;
}
return false;
}
-Mailbox
Ptr
Comm::get_mailbox()
+Mailbox
*
Comm::get_mailbox()
{
return mailbox_;
}
{
return mailbox_;
}
+ActorPtr Comm::get_sender()
+{
+ return sender_ ? sender_->iface() : nullptr;
+}
+
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) {