Skip to content

Commit

Permalink
Fix setPriority error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Sep 3, 2024
1 parent 5d84128 commit 3c312d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libYARP_os/src/yarp/os/impl/ThreadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,15 @@ int ThreadImpl::setPriority(int priority, int policy)
if (std::is_same<std::thread::native_handle_type, ACE_hthread_t>::value) {
return ACE_Thread::setprio(thread.native_handle(), priority, policy);
}
yCError(THREADIMPL, "Cannot set priority without ACE");
yCError(THREADIMPL, "Cannot set priority as std::thread::native_handle_type is not ACE_hthread_t");
#elif defined(__unix__) || defined(__APPLE__)
if (std::is_same<std::thread::native_handle_type, pthread_t>::value) {
struct sched_param thread_param;
thread_param.sched_priority = priority;
int ret = pthread_setschedparam(thread.native_handle(), policy, &thread_param);
return (ret != 0) ? -1 : 0;
} else {
yCError(THREADIMPL, "Cannot set priority without ACE");
yCError(THREADIMPL, "Cannot set priority as std::thread::native_handle_type is not pthread_t");
}
#else
yCError(THREADIMPL, "Cannot set priority without ACE");
Expand Down

0 comments on commit 3c312d1

Please sign in to comment.