X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4f5fc8f2b3102c6372afdc72af990fcdf9abb7ff..872cf95ab5a2b08aa1f2c6ebba29b9f86b0ba54e:/src/include/xbt/parmap.hpp diff --git a/src/include/xbt/parmap.hpp b/src/include/xbt/parmap.hpp index 48ce17e83c..f782f59a7c 100644 --- a/src/include/xbt/parmap.hpp +++ b/src/include/xbt/parmap.hpp @@ -29,8 +29,7 @@ XBT_LOG_EXTERNAL_CATEGORY(xbt_parmap); -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { /** @addtogroup XBT_parmap * @ingroup XBT_misc @@ -310,7 +309,7 @@ template void Parmap::worker_main(ThreadData* data) template void Parmap::PosixSynchro::master_signal() { - std::unique_lock lk(ready_mutex); + std::unique_lock lk(ready_mutex); this->parmap.thread_counter = 1; this->parmap.work_round++; /* wake all workers */ @@ -319,14 +318,14 @@ template void Parmap::PosixSynchro::master_signal() template void Parmap::PosixSynchro::master_wait() { - std::unique_lock lk(done_mutex); + std::unique_lock lk(done_mutex); /* wait for all workers to be ready */ done_cond.wait(lk, [this]() { return this->parmap.thread_counter >= this->parmap.num_workers; }); } template void Parmap::PosixSynchro::worker_signal() { - std::unique_lock lk(done_mutex); + std::unique_lock lk(done_mutex); this->parmap.thread_counter++; if (this->parmap.thread_counter == this->parmap.num_workers) { /* all workers have finished, wake the controller */ @@ -336,7 +335,7 @@ template void Parmap::PosixSynchro::worker_signal() template void Parmap::PosixSynchro::worker_wait(unsigned expected_round) { - std::unique_lock lk(ready_mutex); + std::unique_lock lk(ready_mutex); /* wait for more work */ ready_cond.wait(lk, [this, expected_round]() { return this->parmap.work_round == expected_round; }); } @@ -419,7 +418,6 @@ template void Parmap::BusyWaitSynchro::worker_wait(unsigned roun } /** @} */ -} -} +} // namespace simgrid::xbt #endif