Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
03b701d5
Commit
03b701d5
authored
Sep 07, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
var_AcquireMutex: enforce constant mutex name
parent
e516ddb1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
include/vlc_variables.h
include/vlc_variables.h
+17
-0
src/misc/variables.c
src/misc/variables.c
+1
-0
No files found.
include/vlc_variables.h
View file @
03b701d5
...
...
@@ -131,6 +131,23 @@ VLC_EXPORT( int, __var_Get, ( vlc_object_t *, const char *, vlc_value_t * ) );
VLC_EXPORT
(
int
,
__var_Command
,
(
vlc_object_t
*
,
const
char
*
,
const
char
*
,
const
char
*
,
char
**
)
);
VLC_EXPORT
(
vlc_mutex_t
*
,
var_AcquireMutex
,
(
const
char
*
)
);
#ifdef __GNUC__
static
__attribute__
((
unused
))
__attribute__
((
noinline
))
__attribute__
((
error
(
"variable mutex name leaks memory at run-time"
)))
const
char
*
nonconst_mutex_name
(
const
char
*
str
)
{
return
str
;
}
# define check_named_mutex( m ) \
(__builtin_constant_p(m) ? m : nonconst_mutex_name(m))
#else
# define check_named_mutex( m ) (m)
#endif
#define var_AcquireMutex( n ) var_AcquireMutex(check_named_mutex(n))
/**
* __var_Create() with automatic casting.
...
...
src/misc/variables.c
View file @
03b701d5
...
...
@@ -848,6 +848,7 @@ int __var_Get( vlc_object_t *p_this, const char *psz_name, vlc_value_t *p_val )
}
#undef var_AcquireMutex
/**
* Finds a process-wide mutex, creates it if needed, and locks it.
* Unlock with vlc_mutex_unlock().
...
...
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