Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
attach errhandlers to some forgotten calls
[simgrid.git] / src / xbt / OsSemaphore.hpp
index 6459850..e8bc29b 100644 (file)
@@ -3,6 +3,8 @@
 /* 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 <xbt/base.h>
+
 #include <condition_variable>
 #include <mutex>
 
@@ -10,12 +12,12 @@ namespace simgrid {
 namespace xbt {
 class XBT_PUBLIC OsSemaphore {
 public:
-  inline OsSemaphore(unsigned int uiCount) : capa_(uiCount) {}
+  explicit inline OsSemaphore(unsigned int capa) : capa_(capa) {}
 
   inline void acquire()
   {
     std::unique_lock<std::mutex> lock(mutex_);
-    condition_.wait(lock, [&]() -> bool { return capa_ > 0; });
+    condition_.wait(lock, [this]() { return capa_ > 0; });
     --capa_;
   }