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
21efe649
Commit
21efe649
authored
May 09, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: use vlc_atomic_* instead of vlc_object_(kill|alive)
parent
495130c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
src/misc/update.c
src/misc/update.c
+5
-4
src/misc/update.h
src/misc/update.h
+2
-0
No files found.
src/misc/update.c
View file @
21efe649
...
...
@@ -143,7 +143,7 @@ void update_Delete( update_t *p_update )
if
(
p_update
->
p_download
)
{
vlc_
object_kill
(
p_update
->
p_download
);
vlc_
atomic_set
(
&
p_update
->
p_download
->
aborted
,
1
);
vlc_join
(
p_update
->
p_download
->
thread
,
NULL
);
vlc_object_release
(
p_update
->
p_download
);
}
...
...
@@ -494,7 +494,7 @@ void update_Download( update_t *p_update, const char *psz_destdir )
// If the object already exist, destroy it
if
(
p_update
->
p_download
)
{
vlc_
object_kill
(
p_update
->
p_download
);
vlc_
atomic_set
(
&
p_udt
->
p_download
->
aborted
,
1
);
vlc_join
(
p_update
->
p_download
->
thread
,
NULL
);
vlc_object_release
(
p_update
->
p_download
);
}
...
...
@@ -509,6 +509,7 @@ void update_Download( update_t *p_update, const char *psz_destdir )
p_update
->
p_download
=
p_udt
;
p_udt
->
psz_destdir
=
psz_destdir
?
strdup
(
psz_destdir
)
:
NULL
;
vlc_atomic_set
(
&
p_udt
->
aborted
,
0
);
vlc_clone
(
&
p_udt
->
thread
,
update_DownloadReal
,
p_udt
,
VLC_THREAD_PRIORITY_LOW
);
}
...
...
@@ -589,7 +590,7 @@ static void* update_DownloadReal( void *obj )
if
(
p_progress
==
NULL
)
goto
end
;
while
(
vlc_object_alive
(
p_udt
)
&&
while
(
!
vlc_atomic_get
(
&
p_udt
->
aborted
)
&&
(
i_read
=
stream_Read
(
p_stream
,
p_buffer
,
1
<<
10
)
)
&&
!
dialog_ProgressCancelled
(
p_progress
)
)
{
...
...
@@ -617,7 +618,7 @@ static void* update_DownloadReal( void *obj )
fclose
(
p_file
);
p_file
=
NULL
;
if
(
vlc_object_alive
(
p_udt
)
&&
if
(
!
vlc_atomic_get
(
&
p_udt
->
aborted
)
&&
!
dialog_ProgressCancelled
(
p_progress
)
)
{
dialog_ProgressDestroy
(
p_progress
);
...
...
src/misc/update.h
View file @
21efe649
...
...
@@ -38,6 +38,7 @@
*/
#include <vlc_update.h>
#include <vlc_atomic.h>
enum
/* Public key algorithms */
{
...
...
@@ -152,6 +153,7 @@ typedef struct
VLC_COMMON_MEMBERS
vlc_thread_t
thread
;
vlc_atomic_t
aborted
;
update_t
*
p_update
;
char
*
psz_destdir
;
}
update_download_thread_t
;
...
...
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