Skip to content

Commit

Permalink
Merge pull request #3129 from robotology/traversaro-patch-2
Browse files Browse the repository at this point in the history
Fix setPriority error messages
  • Loading branch information
randaz81 authored Sep 4, 2024
2 parents d3b2af0 + 3c312d1 commit 1fde37e
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 1fde37e

Please sign in to comment.