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
abbdcb63
Commit
abbdcb63
authored
Dec 05, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xlib: check if we can call XInitThreads() before we do so
Parental advisory: naked kludge and explicit hack
parent
5984bb6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
include/vlc_xlib.h
include/vlc_xlib.h
+18
-2
No files found.
include/vlc_xlib.h
View file @
abbdcb63
...
...
@@ -21,7 +21,10 @@
#ifndef VLC_XLIB_H
# define VLC_XLIB_H 1
# include <stdio.h>
# include <stdlib.h>
# include <X11/Xlib.h>
# include <X11/Xlibint.h>
static
inline
bool
vlc_xlib_init
(
vlc_object_t
*
obj
)
{
...
...
@@ -30,9 +33,22 @@ static inline bool vlc_xlib_init (vlc_object_t *obj)
if
(
var_InheritBool
(
obj
,
"xlib"
))
{
/* XInitThreads() can be called multiple times,
* but it is not reentrant. */
* but it is not reentrant
, so we need this global lock
. */
vlc_global_lock
(
VLC_XLIB_MUTEX
);
ok
=
XInitThreads
()
!=
0
;
if
(
_Xglobal_lock
==
NULL
&&
unlikely
(
_XErrorFunction
!=
NULL
))
{
/* (_Xglobal_lock == NULL) => Xlib threads not initialized */
/* (_XErrorFunction != NULL) => Xlib already in use */
fprintf
(
stderr
,
"%s:%u:%u: Xlib not initialized for threads.
\n
"
"This process is probably using LibVLC incorrectly.
\n
"
"Pass
\"
--no-xlib
\"
to libvlc_new() to fix this.
\n
"
,
__FILE__
,
__LINE__
,
__func__
);
/* Initiate core meltdown */
abort
();
}
else
ok
=
XInitThreads
()
!=
0
;
vlc_global_unlock
(
VLC_XLIB_MUTEX
);
}
return
ok
;
...
...
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