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
move parts of the kernel to the right subdir
[simgrid.git]
/
src
/
s4u
/
s4u_mailbox.cpp
diff --git
a/src/s4u/s4u_mailbox.cpp
b/src/s4u/s4u_mailbox.cpp
index
d7f4869
..
e49465c
100644
(file)
--- a/
src/s4u/s4u_mailbox.cpp
+++ b/
src/s4u/s4u_mailbox.cpp
@@
-31,7
+31,7
@@
MailboxPtr Mailbox::byName(const char*name) {
smx_mailbox_t mbox = simcall_mbox_get_by_name(name);
if (mbox == nullptr)
mbox = simcall_mbox_create(name);
smx_mailbox_t mbox = simcall_mbox_get_by_name(name);
if (mbox == nullptr)
mbox = simcall_mbox_create(name);
- return MailboxPtr(&mbox->
mbox
_, true);
+ return MailboxPtr(&mbox->
piface
_, true);
}
bool Mailbox::empty() {
}
bool Mailbox::empty() {
@@
-43,8
+43,9
@@
void Mailbox::setReceiver(Actor* actor) {
}
/** @brief get the receiver (process associated to the mailbox) */
}
/** @brief get the receiver (process associated to the mailbox) */
-Actor& Mailbox::receiver() {
- return pimpl_->permanent_receiver->actor();
+ActorPtr Mailbox::receiver() {
+ if(pimpl_->permanent_receiver == nullptr) return ActorPtr();
+ return ActorPtr(&pimpl_->permanent_receiver->actor());
}
}
}
}
@@
-61,6
+62,3
@@
int sg_mbox_is_empty(sg_mbox_t mbox) {
void sg_mbox_setReceiver(sg_mbox_t mbox, smx_process_t process) {
mbox->setReceiver(&process->actor());
}
void sg_mbox_setReceiver(sg_mbox_t mbox, smx_process_t process) {
mbox->setReceiver(&process->actor());
}
-smx_process_t sg_mbox_receiver(sg_mbox_t mbox) {
- return mbox->receiver().getInferior();
-}