X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8e9b70d3dc4bc81e7f13c923ba3e6a736395d963..cabfcca7cb25b7aa54d7ee1b0a8b117940b85a8d:/src/s4u/s4u_mailbox.cpp diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index d7f48697dc..fe40a3f334 100644 --- 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); - return MailboxPtr(&mbox->mbox_, true); + return MailboxPtr(&mbox->piface_, true); } bool Mailbox::empty() { @@ -43,8 +43,9 @@ void Mailbox::setReceiver(Actor* actor) { } /** @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()); } } @@ -62,5 +63,5 @@ 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(); + return mbox->receiver()->getImpl(); }