Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Concatenate nested namespaces (sonar).
[simgrid.git] / src / xbt / OsSemaphore.hpp
index e8bc29b..6582689 100644 (file)
@@ -1,4 +1,4 @@
-/* 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. */
@@ -8,22 +8,21 @@
 #include <condition_variable>
 #include <mutex>
 
-namespace simgrid {
-namespace xbt {
+namespace simgrid::xbt {
 class XBT_PUBLIC OsSemaphore {
 public:
   explicit inline OsSemaphore(unsigned int capa) : capa_(capa) {}
 
   inline void acquire()
   {
-    std::unique_lock<std::mutex> lock(mutex_);
+    std::unique_lock lock(mutex_);
     condition_.wait(lock, [this]() { return capa_ > 0; });
     --capa_;
   }
 
   inline void release()
   {
-    std::unique_lock<std::mutex> lock(mutex_);
+    std::unique_lock lock(mutex_);
     ++capa_;
     condition_.notify_one();
   }
@@ -33,5 +32,4 @@ private:
   std::mutex mutex_;
   std::condition_variable condition_;
 };
-} // namespace xbt
-} // namespace simgrid
+} // namespace simgrid::xbt