* @brief Try to set the OS priority of this thread to the highest possible value. Also set the name of the thread for debugging purposes. */
| 3098 | * @brief Try to set the OS priority of this thread to the highest possible value. Also set the name of the thread for debugging purposes. |
| 3099 | */ |
| 3100 | void try_os_thread_priority() |
| 3101 | { |
| 3102 | if (!BS::this_thread::set_os_thread_priority(BS::os_thread_priority::realtime)) |
| 3103 | if (!BS::this_thread::set_os_thread_priority(BS::os_thread_priority::highest)) |
| 3104 | BS::this_thread::set_os_thread_priority(BS::os_thread_priority::above_normal); |
| 3105 | std::optional<std::size_t> idx = BS::this_thread::get_index(); |
| 3106 | if (idx.has_value()) |
| 3107 | BS::this_thread::set_os_thread_name(make_string("Benchmark #", *idx)); |
| 3108 | else |
| 3109 | BS::this_thread::set_os_thread_name("Benchmark main"); |
| 3110 | } |
| 3111 | #endif |
| 3112 | |
| 3113 | // ======================== |
no test coverage detected