Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Convert integer literals to bool literals.
[simgrid.git] / src / include / xbt / parmap.hpp
index 51f4818..295ad66 100644 (file)
@@ -1,6 +1,6 @@
 /* A thread pool (C++ version).                                             */
 
-/* Copyright (c) 2004-2019 The SimGrid Team. All rights reserved.           */
+/* Copyright (c) 2004-2020 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. */
@@ -96,8 +96,7 @@ private:
 
   class PosixSynchro : public Synchro {
   public:
-    explicit PosixSynchro(Parmap<T>& parmap);
-    ~PosixSynchro();
+    explicit PosixSynchro(Parmap<T>& parmap) : Synchro(parmap) {}
     void master_signal() override;
     void master_wait() override;
     void worker_signal() override;
@@ -295,7 +294,7 @@ template <typename T> void Parmap<T>::worker_main(ThreadData* data)
   XBT_CDEBUG(xbt_parmap, "New worker thread created");
 
   /* Worker's main loop */
-  while (1) {
+  while (true) {
     round++; // New scheduling round
     parmap.synchro->worker_wait(round);
     if (parmap.destroying)
@@ -311,14 +310,6 @@ template <typename T> void Parmap<T>::worker_main(ThreadData* data)
   delete data;
 }
 
-template <typename T> Parmap<T>::PosixSynchro::PosixSynchro(Parmap<T>& parmap) : Synchro(parmap)
-{
-}
-
-template <typename T> Parmap<T>::PosixSynchro::~PosixSynchro()
-{
-}
-
 template <typename T> void Parmap<T>::PosixSynchro::master_signal()
 {
   std::unique_lock<std::mutex> lk(ready_mutex);