You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Sched OTHER has a nice value, that we pull from the priority parameter.
85
91
// - Requires priorty value to be zero (0).
86
-
//
92
+
//
87
93
result = pthread_setschedparam(self_tid, sched_class, ¶m);
88
-
if(0 == result && change_priority)
94
+
if(0 == result && change_priority)
89
95
{
90
96
uint64_t tid;
91
97
pthread_threadid_np(NULL, &tid);
92
98
result = setpriority(PRIO_PROCESS, tid, sched_priority);
93
-
}
99
+
if (0 != result)
100
+
{
101
+
EPROSIMA_LOG_ERROR(SYSTEM, "Problem to set priority of thread with id [" << tid << "," << thread_name << "] to value " << sched_priority << ". Error '" << strerror(
102
+
result) << "'");
103
+
}
104
+
}
105
+
elseif (0 != result)
106
+
{
107
+
EPROSIMA_LOG_ERROR(SYSTEM, "Problem to set scheduler of thread with id [" << self_tid << "," << thread_name << "] to value " << sched_class << ". Error '" << strerror(
108
+
result) << "'");
109
+
}
94
110
}
95
-
elseif((sched_class == SCHED_FIFO) ||
111
+
elseif((sched_class == SCHED_FIFO) ||
96
112
(sched_class == SCHED_RR))
97
113
{
98
114
//
99
115
// RT Policies use a different priority numberspace.
EPROSIMA_LOG_ERROR(SYSTEM, "Problem to set scheduler of thread with id [" << self_tid << "," << thread_name << "] to value " << sched_class << " with priority " << param.sched_priority << ". Error '" << strerror(
122
+
result) << "'");
123
+
}
109
124
}
110
125
}
111
126
112
127
staticvoidconfigure_current_thread_affinity(
128
+
constchar* thread_name,
113
129
uint64_t affinity)
114
130
{
115
131
if (affinity <= static_cast<uint64_t>(std::numeric_limits<integer_t>::max()))
EPROSIMA_LOG_ERROR(SYSTEM, "Problem to set affinity of thread with id [" << self_tid << "," << thread_name << "] to value " << affinity << ". Error '" << strerror(
0 commit comments