X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1bf8ac043266839571c3a5fa789557fff825db5a..9b466758c546f0cbf96e8c069daa2c08887452a4:/src/s4u/s4u_mailbox.cpp diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index 2fa5db2809..288205124b 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -41,6 +41,11 @@ bool Mailbox::empty() return pimpl_->comm_queue.empty(); } +bool Mailbox::listen() +{ + return not this->empty() || (pimpl_->permanent_receiver && not pimpl_->done_comm_queue.empty()); +} + smx_activity_t Mailbox::front() { return pimpl_->comm_queue.empty() ? nullptr : pimpl_->comm_queue.front(); @@ -54,9 +59,9 @@ void Mailbox::setReceiver(ActorPtr actor) { /** @brief get the receiver (process associated to the mailbox) */ ActorPtr Mailbox::receiver() { - if(pimpl_->permanent_receiver == nullptr) + if (pimpl_->permanent_receiver == nullptr) return ActorPtr(); - return ActorPtr(&pimpl_->permanent_receiver->getIface()); + return pimpl_->permanent_receiver->iface(); } }