- Flag status; /**< is the parmap active or being destroyed? */
- unsigned work_round; /**< index of the current round */
- unsigned thread_counter; /**< number of workers that have done the work */
- unsigned num_workers; /**< total number of worker threads including the controller */
- xbt_os_thread_t* workers; /**< worker thread handlers */
- void (*fun)(const T); /**< function to run in parallel on each element of data */
- const std::vector<T>* data; /**< parameters to pass to fun in parallel */
- std::atomic<unsigned> index; /**< index of the next element of data to pick */
- Synchro* synchro; /**< synchronization object */
+ bool destroying = false; /**< is the parmap being destroyed? */
+ std::atomic_uint work_round{0}; /**< index of the current round */
+ std::vector<std::thread*> workers; /**< worker thread handlers */
+ unsigned num_workers; /**< total number of worker threads including the controller */
+ Synchro* synchro; /**< synchronization object */
+
+ std::atomic_uint thread_counter{0}; /**< number of workers that have done the work */
+ std::function<void(T)> worker_fun; /**< function to run in parallel on each element of data */
+ const std::vector<T>* common_data = nullptr; /**< parameters to pass to fun in parallel */
+ std::atomic_uint common_index{0}; /**< index of the next element of data to pick */