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
a332d4e1
Commit
a332d4e1
authored
Jul 06, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_savecancel, vlc_restorecancel: POSIX cancellation state management
parent
cfb6c98d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
include/vlc_threads.h
include/vlc_threads.h
+27
-1
No files found.
include/vlc_threads.h
View file @
a332d4e1
...
...
@@ -3,7 +3,7 @@
* This header provides portable declarations for mutexes & conditions
*****************************************************************************
* Copyright (C) 1999, 2002 the VideoLAN team
*
$Id$
*
Copyright © 2007-2008 Rémi Denis-Courmont
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
...
...
@@ -588,6 +588,32 @@ static inline void barrier (void)
#endif
}
/**
* Save the cancellation state and disable cancellation for the calling thread.
* This function must be called before entering a piece of code that is not
* cancellation-safe.
* @param p_state storage for the previous cancellation state
* @return Nothing, always succeeds.
*/
static
inline
void
vlc_savecancel
(
int
*
p_state
)
{
#if defined (LIBVLC_USE_PTHREAD)
(
void
)
pthread_setcancelstate
(
PTHREAD_CANCEL_DISABLE
,
p_state
);
#endif
}
/**
* Restore the cancellation state for the calling thread.
* @param state previous state as returned by vlc_savecancel().
* @return Nothing, always succeeds.
*/
static
inline
void
vlc_restorecancel
(
int
state
)
{
#if defined (LIBVLC_USE_PTHREAD)
(
void
)
pthread_setcancelstate
(
state
,
NULL
);
#endif
}
/*****************************************************************************
* vlc_thread_create: create a thread
*****************************************************************************/
...
...
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