|
ThreadSchedule 3.0.0
Modern C++ thread management library
|
Registry for named/configurable threads. More...
#include <thread_registry.hpp>
Public Member Functions | |
| thread_registry () | |
| Construct an owning registry instance. | |
| thread_registry (thread_registry &&) noexcept=default | |
| auto | operator= (thread_registry &&other) -> thread_registry & |
| thread_registry (thread_registry const &)=delete | |
| auto | operator= (thread_registry const &) -> thread_registry &=delete |
| auto | register_current_thread (std::string name={}, std::string component={}) -> result< void > |
| Register the calling thread. | |
| auto | unregister_current_thread () -> result< void > |
| Unregister the calling thread. | |
| auto | count () const -> std::size_t |
| Return number of tracked entries. | |
| auto | empty () const -> bool |
| Return whether registry has no tracked entries. | |
| auto | snapshot () const -> result< std::vector< registered_thread > > |
| Take a snapshot of all registry entries. | |
| auto | configure (thread_id id, thread_config const &config) -> result< void > |
| Apply configuration to a registered thread. | |
| auto | set_priority (thread_id id, priority_level level) -> result< void > |
| Set portable priority preset for a registered thread. | |
| auto | set_nice (thread_id id, nice_value value) -> result< void > |
| Set explicit nice value for a registered thread. | |
| auto | get_priority (thread_id id) const -> result< priority_level > |
| Query portable priority preset for a registered thread. | |
| auto | get_nice (thread_id id) const -> result< nice_value > |
| Query nice value for a registered thread. | |
Static Public Member Functions | |
| static auto | create () -> result< thread_registry > |
| Create an owning registry without throwing. | |
Friends | |
| class | global_registry_binding |
| class | auto_register_current_thread |
| class | advanced::composite_thread_registry |
| auto | global_registry () -> thread_registry & |
Registry for named/configurable threads.
The global facade returned by global_registry is backed by runtime storage and can optionally be rebound to another registry via global_registry_binding.
Definition at line 60 of file thread_registry.hpp.
|
inline |
Construct an owning registry instance.
Definition at line 64 of file thread_registry.hpp.
|
defaultnoexcept |
|
delete |
|
inline |
Apply configuration to a registered thread.
| id | Registry thread id. |
| config | Portable configuration to apply. |
Definition at line 206 of file thread_registry.hpp.
References threadschedule::detail::to_native(), and threadschedule::detail::try_result().
|
inline |
Return number of tracked entries.
Definition at line 164 of file thread_registry.hpp.
|
inlinestatic |
Create an owning registry without throwing.
Definition at line 124 of file thread_registry.hpp.
References threadschedule::detail::try_result().
|
inline |
Return whether registry has no tracked entries.
Definition at line 171 of file thread_registry.hpp.
|
inline |
Query nice value for a registered thread.
Definition at line 259 of file thread_registry.hpp.
References threadschedule::detail::try_result().
|
inline |
Query portable priority preset for a registered thread.
Definition at line 240 of file thread_registry.hpp.
References threadschedule::detail::to_priority_level(), and threadschedule::detail::try_result().
|
inline |
|
delete |
|
inline |
Register the calling thread.
| name | Optional thread name. |
| component | Optional component label. |
Definition at line 135 of file thread_registry.hpp.
|
inline |
Set explicit nice value for a registered thread.
Definition at line 226 of file thread_registry.hpp.
References threadschedule::detail::native_schedule::posix_nice(), and threadschedule::detail::try_result().
Referenced by set_priority().
|
inline |
Set portable priority preset for a registered thread.
Definition at line 219 of file thread_registry.hpp.
References set_nice().
|
inline |
Take a snapshot of all registry entries.
Definition at line 181 of file thread_registry.hpp.
References threadschedule::detail::thread_id_access::make(), and threadschedule::detail::try_result().
|
inline |
Unregister the calling thread.
Definition at line 150 of file thread_registry.hpp.
References threadschedule::detail::try_result().
|
friend |
Definition at line 337 of file thread_registry.hpp.
|
friend |
Definition at line 336 of file thread_registry.hpp.
|
friend |
Definition at line 341 of file thread_registry.hpp.
|
friend |
Definition at line 335 of file thread_registry.hpp.