-smx_activity_t MailboxImpl::iprobe(int type, int (*match_fun)(void*, void*, CommImpl*), void* data)
+/** @brief Removes all communication activities from a mailbox
+ */
+void MailboxImpl::clear()
+{
+ for (auto comm : done_comm_queue_) {
+ comm->cancel();
+ comm->set_state(State::DST_HOST_FAILURE);
+ }
+ done_comm_queue_.clear();
+
+ // CommImpl::cancel() will remove the comm from the mailbox..
+ while (not comm_queue_.empty()) {
+ auto comm = comm_queue_.back();
+ if (comm->get_state() == State::WAITING && not comm->is_detached()) {
+ comm->cancel();
+ comm->set_state(State::DST_HOST_FAILURE);
+ } else
+ comm_queue_.pop_back();
+ }
+}
+
+CommImplPtr MailboxImpl::iprobe(int type, bool (*match_fun)(void*, void*, CommImpl*), void* data)