Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
418410c4
Commit
418410c4
authored
Jul 24, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_thread_set_priority: don't mess up the thread_id
parent
36ca011c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
src/misc/threads.c
src/misc/threads.c
+12
-5
No files found.
src/misc/threads.c
View file @
418410c4
...
@@ -622,6 +622,17 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
...
@@ -622,6 +622,17 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
{
{
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
if
(
!
p_priv
->
b_thread
)
{
#ifndef __APPLE__
msg_Err
(
p_this
,
"couldn't set priority of non-existent thread"
);
return
ESRCH
;
#else
# warning FIXME: this is wrong
p_priv
->
b_thread
=
pthread_self
();
#endif
}
#if defined( LIBVLC_USE_PTHREAD )
#if defined( LIBVLC_USE_PTHREAD )
# ifndef __APPLE__
# ifndef __APPLE__
if
(
config_GetInt
(
p_this
,
"rt-priority"
)
>
0
)
if
(
config_GetInt
(
p_this
,
"rt-priority"
)
>
0
)
...
@@ -643,10 +654,8 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
...
@@ -643,10 +654,8 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
param
.
sched_priority
=
i_priority
;
param
.
sched_priority
=
i_priority
;
i_policy
=
SCHED_RR
;
i_policy
=
SCHED_RR
;
}
}
if
(
!
p_priv
->
thread_id
)
p_priv
->
thread_id
=
pthread_self
();
if
(
(
i_error
=
pthread_setschedparam
(
p_priv
->
thread_id
,
if
(
(
i_error
=
pthread_setschedparam
(
p_priv
->
thread_id
,
i_policy
,
&
param
))
)
i_policy
,
&
param
))
)
{
{
errno
=
i_error
;
errno
=
i_error
;
msg_Warn
(
p_this
,
"couldn't set thread priority (%s:%d): %m"
,
msg_Warn
(
p_this
,
"couldn't set thread priority (%s:%d): %m"
,
...
@@ -658,8 +667,6 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
...
@@ -658,8 +667,6 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
#elif defined( WIN32 ) || defined( UNDER_CE )
#elif defined( WIN32 ) || defined( UNDER_CE )
VLC_UNUSED
(
psz_file
);
VLC_UNUSED
(
i_line
);
VLC_UNUSED
(
psz_file
);
VLC_UNUSED
(
i_line
);
if
(
!
p_priv
->
thread_id
)
p_priv
->
thread_id
=
GetCurrentThread
();
if
(
!
SetThreadPriority
(
p_priv
->
thread_id
,
i_priority
)
)
if
(
!
SetThreadPriority
(
p_priv
->
thread_id
,
i_priority
)
)
{
{
msg_Warn
(
p_this
,
"couldn't set a faster priority"
);
msg_Warn
(
p_this
,
"couldn't set a faster priority"
);
...
...
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