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

Method get_pool

include/BS_thread_pool.hpp:987–990  ·  view source on GitHub ↗

* @brief Get a pointer to the thread pool that owns the current thread. If this thread belongs to a `BS::thread_pool` object, the return value will be a `void` pointer to that object. Otherwise, for example if this thread is the main thread or an independent thread not in any pools, `std::nullopt` will be returned. * * @return An `std::optional` object, optionally containing a pointer to

Source from the content-addressed store, hash-verified

985 * @return An `std::optional` object, optionally containing a pointer to a thread pool. Note that this will be a `void` pointer, so it must be cast to the desired instantiation of the `BS::thread_pool` template in order to use any member functions.
986 */
987 [[nodiscard]] static std::optional<void*> get_pool() noexcept
988 {
989 return my_pool;
990 }
991
992#ifdef BS_THREAD_POOL_NATIVE_EXTENSIONS
993 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected