X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bd681bde4c1fcad799c5c7c7ee5b58ad345157ef..8e3525c475262f259a70a3f9a2a4f12d36b3d243:/src/xbt/OsSemaphore.hpp?ds=sidebyside diff --git a/src/xbt/OsSemaphore.hpp b/src/xbt/OsSemaphore.hpp index f6e7083946..b29a66550d 100644 --- a/src/xbt/OsSemaphore.hpp +++ b/src/xbt/OsSemaphore.hpp @@ -1,8 +1,10 @@ -/* Copyright (c) 2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2019-2022. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include + #include #include @@ -14,14 +16,14 @@ public: inline void acquire() { - std::unique_lock lock(mutex_); + std::unique_lock lock(mutex_); condition_.wait(lock, [this]() { return capa_ > 0; }); --capa_; } inline void release() { - std::unique_lock lock(mutex_); + std::unique_lock lock(mutex_); ++capa_; condition_.notify_one(); }