Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
fc921ab8
Commit
fc921ab8
authored
Oct 12, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Android: thread->killable does not need to be atomic
parent
e7eb250a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
src/android/thread.c
src/android/thread.c
+5
-7
No files found.
src/android/thread.c
View file @
fc921ab8
...
...
@@ -172,9 +172,9 @@ struct vlc_thread
void
*
(
*
entry
)(
void
*
);
void
*
data
;
vlc_atomic_t
killable
;
vlc_atomic_t
killed
;
vlc_atomic_t
finished
;
bool
killable
;
bool
detached
;
};
...
...
@@ -306,9 +306,9 @@ static int vlc_clone_attr (vlc_thread_t *th, pthread_attr_t *attr,
return
ENOMEM
;
}
vlc_atomic_set
(
&
thread
->
killable
,
true
);
vlc_atomic_set
(
&
thread
->
killed
,
false
);
vlc_atomic_set
(
&
thread
->
finished
,
false
);
thread
->
killable
=
true
;
int
state
=
PTHREAD_CREATE_JOINABLE
;
if
(
attr
)
pthread_attr_getdetachstate
(
attr
,
&
state
);
...
...
@@ -371,8 +371,6 @@ int vlc_set_priority (vlc_thread_t th, int priority)
void
vlc_cancel
(
vlc_thread_t
thread_id
)
{
vlc_atomic_set
(
&
thread_id
->
killed
,
true
);
if
(
!
vlc_atomic_get
(
&
thread_id
->
killable
))
return
;
vlc_mutex_lock
(
&
thread_id
->
lock
);
vlc_cond_t
*
cond
=
thread_id
->
cond
;
...
...
@@ -388,7 +386,7 @@ int vlc_savecancel (void)
return
true
;
int
oldstate
=
vlc_atomic_get
(
&
thread
->
killable
);
vlc_atomic_set
(
&
thread
->
killable
,
false
)
;
thread
->
killable
=
false
;
return
oldstate
;
}
...
...
@@ -397,14 +395,14 @@ void vlc_restorecancel (int state)
if
(
!
thread
)
/* not created by VLC, can't be cancelled */
return
;
vlc_atomic_set
(
&
thread
->
killable
,
state
)
;
thread
->
killable
=
state
;
}
void
vlc_testcancel
(
void
)
{
if
(
!
thread
)
/* not created by VLC, can't be cancelled */
return
;
if
(
!
vlc_atomic_get
(
&
thread
->
killable
)
)
if
(
!
thread
->
killable
)
return
;
if
(
!
vlc_atomic_get
(
&
thread
->
killed
))
return
;
...
...
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