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
779d3cdf
Commit
779d3cdf
authored
Jul 06, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_cancel: POSIX thread cancellation
parent
a332d4e1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
include/vlc_threads.h
include/vlc_threads.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/threads.c
src/misc/threads.c
+15
-0
No files found.
include/vlc_threads.h
View file @
779d3cdf
...
...
@@ -177,6 +177,7 @@ VLC_EXPORT( int, __vlc_thread_set_priority, ( vlc_object_t *, const char *, int
VLC_EXPORT
(
void
,
__vlc_thread_join
,
(
vlc_object_t
*
,
const
char
*
,
int
)
);
VLC_EXPORT
(
int
,
vlc_clone
,
(
vlc_thread_t
*
,
void
*
(
*
)
(
void
*
),
void
*
,
int
)
);
VLC_EXPORT
(
void
,
vlc_cancel
,
(
vlc_thread_t
)
);
VLC_EXPORT
(
int
,
vlc_join
,
(
vlc_thread_t
,
void
**
)
);
#define vlc_thread_ready vlc_object_signal
...
...
src/libvlccore.sym
View file @
779d3cdf
...
...
@@ -415,6 +415,7 @@ vlc_b64_decode_binary
vlc_b64_decode_binary_to_buffer
vlc_b64_encode
vlc_b64_encode_binary
vlc_cancel
VLC_Changeset
vlc_clone
VLC_CompileBy
...
...
src/misc/threads.c
View file @
779d3cdf
...
...
@@ -559,6 +559,20 @@ int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
return
ret
;
}
/**
* Marks a thread as cancelled. Next time the target thread reaches a
* cancellation point (while not having disabled cancellation), it will
* run its cancellation cleanup handler, the thread variable destructors, and
* terminate. vlc_join() must be used afterward regardless of a thread being
* cancelled or not.
*/
void
vlc_cancel
(
vlc_thread_t
thread_id
)
{
#if defined (LIBVLC_USE_PTHREAD)
pthread_cancel
(
thread_id
);
#endif
}
/**
* Waits for a thread to complete (if needed), and destroys it.
* @param handle thread handle
...
...
@@ -814,3 +828,4 @@ error:
p_priv
->
b_thread
=
false
;
}
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