A class used to obtain information about the current thread and, if native extensions are enabled, get/set its priority, affinity, or name.
More...
#include <BS_thread_pool.hpp>
|
| static std::optional< std::size_t > | get_index () noexcept |
| | Get the index of the current thread. If this thread belongs to a BS::thread_pool object, the return value will be an index in the range [0, N) where N == BS::thread_pool::get_thread_count(). Otherwise, for example if this thread is the main thread or an independent thread not in any pools, std::nullopt will be returned.
|
| static std::optional< void * > | get_pool () noexcept |
| | 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.
|
|
| static std::optional< std::size_t > | my_index = std::nullopt |
| static std::optional< void * > | my_pool = std::nullopt |
A class used to obtain information about the current thread and, if native extensions are enabled, get/set its priority, affinity, or name.
◆ get_index()
| std::optional< std::size_t > BS::this_thread::get_index |
( |
| ) |
|
|
inlinestaticnodiscardnoexcept |
Get the index of the current thread. If this thread belongs to a BS::thread_pool object, the return value will be an index in the range [0, N) where N == BS::thread_pool::get_thread_count(). Otherwise, for example if this thread is the main thread or an independent thread not in any pools, std::nullopt will be returned.
- Returns
- An std::optional object, optionally containing a thread index.
978 {
980 }
static std::optional< std::size_t > my_index
Definition BS_thread_pool.hpp:1347
◆ get_pool()
| std::optional< void * > BS::this_thread::get_pool |
( |
| ) |
|
|
inlinestaticnodiscardnoexcept |
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.
- Returns
- 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.
988 {
990 }
static std::optional< void * > my_pool
Definition BS_thread_pool.hpp:1348
◆ thread_pool
◆ my_index
| std::optional<std::size_t> BS::this_thread::my_index = std::nullopt |
|
inlinethread_localstaticprivate |
◆ my_pool
| std::optional<void*> BS::this_thread::my_pool = std::nullopt |
|
inlinethread_localstaticprivate |
The documentation for this class was generated from the following file: