| 17 | } |
| 18 | |
| 19 | void OSThreadNiceValue::set([[maybe_unused]] const Int32 value, [[maybe_unused]] const UInt32 thread_id) |
| 20 | { |
| 21 | #if defined(OS_LINUX) |
| 22 | if (hasLinuxCapability(CAP_SYS_NICE)) |
| 23 | { |
| 24 | if (setpriority(PRIO_PROCESS, thread_id, value) != 0) |
| 25 | { |
| 26 | throw ErrnoException(ErrorCodes::CANNOT_SET_THREAD_PRIORITY, |
| 27 | "Failed to set the nice value {} for thread {}", value, thread_id); |
| 28 | } |
| 29 | } |
| 30 | #endif |
| 31 | } |
| 32 | |
| 33 | scope_guard OSThreadNiceValue::scoped([[maybe_unused]] const Int32 value, [[maybe_unused]] const UInt32 thread_id) |
| 34 | { |
nothing calls this directly
no test coverage detected