@@ -165,14 +165,13 @@ bool setProcessPriority(pprocess_t& process, DWORD priority)
165165 return false ;
166166 }
167167
168- auto restore_priority = [&]()
169- {
168+ auto restore_priority = [&]() {
170169 if (!::SetPriorityClass (process, old_process_priority))
171170 {
172171 DWORD err = GetLastError ();
173172 URCL_LOG_ERROR (" Failed to restore previous process priority %s (0x%X). Error: %lu (%s)" ,
174- processPriorityToString (old_process_priority), old_process_priority,
175- err, getLastWindowsErrorMsg (err).c_str ());
173+ processPriorityToString (old_process_priority), old_process_priority, err ,
174+ getLastWindowsErrorMsg (err).c_str ());
176175 }
177176 else
178177 {
@@ -267,24 +266,22 @@ bool setThreadPriority(pthread_t& thread, const int priority)
267266 if (old_priority == THREAD_PRIORITY_ERROR_RETURN )
268267 {
269268 DWORD err = GetLastError ();
270- URCL_LOG_ERROR (" Unsuccessful in retrieving the current thread priority. Error: %lu (%s)" ,
271- err, getLastWindowsErrorMsg (err).c_str ());
269+ URCL_LOG_ERROR (" Unsuccessful in retrieving the current thread priority. Error: %lu (%s)" , err,
270+ getLastWindowsErrorMsg (err).c_str ());
272271 return false ;
273272 }
274-
275- auto restore_priority = [&]()
276- {
273+
274+ auto restore_priority = [&]() {
277275 if (!::SetThreadPriority (thread, old_priority))
278276 {
279277 DWORD err = GetLastError ();
280278 URCL_LOG_ERROR (" Failed to restore previous thread priority %s (%d). Error: %lu (%s)" ,
281- threadPriorityToString (old_priority), old_priority,
282- err, getLastWindowsErrorMsg (err).c_str ());
279+ threadPriorityToString (old_priority), old_priority, err, getLastWindowsErrorMsg (err).c_str ());
283280 }
284281 else
285282 {
286- URCL_LOG_INFO (" Previous thread priority successfully restored to %s (%d)" ,
287- threadPriorityToString (old_priority), old_priority);
283+ URCL_LOG_INFO (" Previous thread priority successfully restored to %s (%d)" , threadPriorityToString (old_priority),
284+ old_priority);
288285 }
289286 };
290287
@@ -412,15 +409,15 @@ bool setFiFoScheduling(pthread_t& thread, int priority)
412409 if (!setThreadPriority (thread, priority))
413410 {
414411 URCL_LOG_ERROR (" Unsuccessful in setting thread priority to %s (%d)" , threadPriorityToString (priority), priority);
415- URCL_LOG_INFO (" Restoring previous process priority %s (0x%X)" ,
416- processPriorityToString (old_process_priority), old_process_priority);
412+ URCL_LOG_INFO (" Restoring previous process priority %s (0x%X)" , processPriorityToString (old_process_priority),
413+ old_process_priority);
417414
418415 if (!::SetPriorityClass (process, old_process_priority))
419416 {
420417 DWORD err = GetLastError ();
421418 URCL_LOG_ERROR (" Failed to restore previous process priority %s (0x%X). Error: %lu (%s)" ,
422- processPriorityToString (old_process_priority), old_process_priority,
423- err, getLastWindowsErrorMsg (err).c_str ());
419+ processPriorityToString (old_process_priority), old_process_priority, err,
420+ getLastWindowsErrorMsg (err).c_str ());
424421 }
425422
426423 return false ;
0 commit comments