X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..3203afd846219ef8b41cadda945ea0a98103c46f:/teshsuite/mc/mutex-handling/mutex-handling.cpp diff --git a/teshsuite/mc/mutex-handling/mutex-handling.cpp b/teshsuite/mc/mutex-handling/mutex-handling.cpp index 22224b656d..adb9519796 100644 --- a/teshsuite/mc/mutex-handling/mutex-handling.cpp +++ b/teshsuite/mc/mutex-handling/mutex-handling.cpp @@ -24,6 +24,8 @@ #include "simgrid/s4u/Mailbox.hpp" #include "simgrid/s4u/Mutex.hpp" +#include // std::unique_lock + XBT_LOG_NEW_DEFAULT_CATEGORY(mutex_handling, "Messages specific for this test"); static int receiver(const char* box_name) @@ -45,14 +47,11 @@ static int sender(const char* box_name, simgrid::s4u::MutexPtr mutex, int value) auto* payload = new int(value); auto mb = simgrid::s4u::Mailbox::by_name(box_name); + std::unique_lock lock; if (mutex) - mutex->lock(); + lock = std::unique_lock(*mutex); mb->put(payload, 8); - - if (mutex) - mutex->unlock(); - return 0; }