MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / set

Method set

src/Common/OSThreadNiceValue.cpp:19–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

hasLinuxCapabilityFunction · 0.85
ErrnoExceptionClass · 0.85

Tested by

no test coverage detected