Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph
Commits
37c0b51f
Commit
37c0b51f
authored
Nov 21, 2018
by
Alexis Nicolin
Committed by
olivier stasse
Dec 20, 2018
Browse files
Fixed RealTimeLogger scheduler and priority
parent
fcfd0a02
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/debug/real-time-logger.cpp
View file @
37c0b51f
...
...
@@ -94,6 +94,19 @@ namespace dynamicgraph
void
spin
(
RealTimeLogger
*
logger
)
{
// Change the thread's scheduler from real-time to normal and reduce its priority
int
threadPolicy
;
struct
sched_param
threadParam
;
if
(
pthread_getschedparam
(
pthread_self
(),
&
threadPolicy
,
&
threadParam
)
==
0
)
{
threadPolicy
=
SCHED_OTHER
;
threadParam
.
sched_priority
-=
5
;
if
(
threadParam
.
sched_priority
<
sched_get_priority_min
(
threadPolicy
))
threadParam
.
sched_priority
=
sched_get_priority_min
(
threadPolicy
);
pthread_setschedparam
(
pthread_self
(),
threadPolicy
,
&
threadParam
);
}
while
(
!
requestShutdown_
||
!
logger
->
empty
())
{
// If the logger did not write anything, it means the buffer is empty.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment