MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / get_thread_ids

Function get_thread_ids

include/BS_thread_pool.hpp:1702–1708  ·  view source on GitHub ↗

* @brief Get a vector containing the unique identifiers for each of the pool's threads, as obtained by `std::thread::get_id()` (or `std::jthread::get_id()` in C++20 and later). * * @return The unique thread identifiers. */

Source from the content-addressed store, hash-verified

1700 * @return The unique thread identifiers.
1701 */
1702 [[nodiscard]] std::vector<thread_t::id> get_thread_ids() const
1703 {
1704 std::vector<thread_t::id> thread_ids(thread_count);
1705 for (std::size_t i = 0; i < thread_count; ++i)
1706 thread_ids[i] = threads[i].get_id();
1707 return thread_ids;
1708 }
1709
1710 /**
1711 * @brief Check whether the pool is currently paused. Only enabled if the flag `BS::tp::pause` is enabled in the template parameter.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected