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
14e89cbc
Commit
14e89cbc
authored
Oct 20, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_mutex_locker: automatic mutex locking for C++
parent
9a38b276
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
include/vlc_threads.h
include/vlc_threads.h
+23
-0
No files found.
include/vlc_threads.h
View file @
14e89cbc
...
@@ -448,4 +448,27 @@ static inline void barrier (void)
...
@@ -448,4 +448,27 @@ static inline void barrier (void)
#define vlc_thread_join( P_THIS ) \
#define vlc_thread_join( P_THIS ) \
__vlc_thread_join( VLC_OBJECT(P_THIS) )
__vlc_thread_join( VLC_OBJECT(P_THIS) )
#ifdef __cplusplus
/**
* Helper C++ class to lock a mutex.
* The mutex is locked when the object is created, and unlocked when the object
* is destroyed.
*/
class
vlc_mutex_locker
{
private:
vlc_mutex_t
*
lock
;
public:
vlc_mutex_locker
(
vlc_mutex_t
*
m
)
:
lock
(
m
)
{
vlc_mutex_lock
(
lock
);
}
~
vlc_mutex_locker
(
void
)
{
vlc_mutex_unlock
(
lock
);
}
};
#endif
#endif
/* !_VLC_THREADS_H */
#endif
/* !_VLC_THREADS_H */
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