* @brief Trigger the pipeline stage init step. * * This can be called from multi-threaded code. The first thread to hit this will process the * initialization. Other threads will block and wait for it to complete. * * @param init_func Callable which executes the stage initialization. It must return the * total number of tasks in the stage. */
| 179 | * total number of tasks in the stage. |
| 180 | */ |
| 181 | void init(std::function<size_t(void)> init_func) |
| 182 | { |
| 183 | std::lock_guard<std::mutex> lck(m_lock); |
| 184 | if (!m_init_done) |
| 185 | { |
| 186 | m_task_count = init_func(); |
| 187 | m_init_done = true; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * @brief Trigger the pipeline stage init step. |
no test coverage detected