Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
db059f56
Commit
db059f56
authored
Aug 08, 2011
by
Simon Morlat
Browse files
allow MSTicker to run with sched_rr whenever permitted
parent
c3ced7f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
src/msticker.c
src/msticker.c
+10
-9
No files found.
src/msticker.c
View file @
db059f56
...
...
@@ -276,16 +276,17 @@ static int set_high_prio(void){
#else
struct
sched_param
param
;
memset
(
&
param
,
0
,
sizeof
(
param
));
#ifdef TARGET_OS_MAC
int
policy
=
SCHED_RR
;
#else
int
policy
=
SCHED_OTHER
;
#endif
param
.
sched_priority
=
sched_get_priority_max
(
policy
);
if
((
result
=
pthread_setschedparam
(
pthread_self
(),
policy
,
&
param
)))
{
ms_warning
(
"Set sched param failed with error code(%i)
\n
"
,
result
);
param
.
sched_priority
=
sched_get_priority_max
(
SCHED_RR
);
if
((
result
=
pthread_setschedparam
(
pthread_self
(),
SCHED_RR
,
&
param
)))
{
if
(
result
==
EPERM
){
param
.
sched_priority
=
sched_get_priority_max
(
SCHED_OTHER
);
if
((
result
=
pthread_setschedparam
(
pthread_self
(),
SCHED_OTHER
,
&
param
)))
{
ms_warning
(
"Set pthread_setschedparam failed: %s"
,
strerror
(
result
));
}
else
ms_message
(
"MS ticker priority set to SCHED_OTHER and max (%i)"
,
param
.
sched_priority
);
}
else
ms_warning
(
"Set pthread_setschedparam failed: %s"
,
strerror
(
result
));
}
else
{
ms_message
(
"MS ticker priority set to max (%i)"
,
param
.
sched_priority
);
ms_message
(
"MS ticker priority set to
SCHED_RR and
max (%i)"
,
param
.
sched_priority
);
}
#endif
return
precision
;
...
...
Write
Preview
Markdown
is supported
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