From fff9fbf510e8ac37ddb3bb622453d8b598806adf Mon Sep 17 00:00:00 2001 From: Fabien Chaix Date: Thu, 17 Mar 2022 19:59:07 +0200 Subject: [PATCH] Expose MailboxImpl::clear() to improve handling of node faults --- include/simgrid/s4u/Mailbox.hpp | 3 +++ src/s4u/s4u_Mailbox.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/simgrid/s4u/Mailbox.hpp b/include/simgrid/s4u/Mailbox.hpp index fe9f875eca..d48166dfe3 100644 --- a/include/simgrid/s4u/Mailbox.hpp +++ b/include/simgrid/s4u/Mailbox.hpp @@ -124,6 +124,9 @@ public: /** Blocking data reception with timeout */ template T* get(double timeout); template std::unique_ptr get_unique(double timeout) { return std::unique_ptr(get(timeout)); } + + void clear(); + }; template CommPtr Mailbox::get_async(T** data) diff --git a/src/s4u/s4u_Mailbox.cpp b/src/s4u/s4u_Mailbox.cpp index a0c99e5832..d692395a97 100644 --- a/src/s4u/s4u_Mailbox.cpp +++ b/src/s4u/s4u_Mailbox.cpp @@ -134,6 +134,11 @@ Mailbox::iprobe(int type, const std::functioniprobe(type, match_fun, data); }); } + +void Mailbox::clear() { + pimpl_->clear(); +} + } // namespace s4u } // namespace simgrid -- 2.20.1