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
8b270041
Commit
8b270041
authored
May 29, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Block all signals in VLC threads
parent
debed14a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
src/misc/threads.c
src/misc/threads.c
+19
-0
No files found.
src/misc/threads.c
View file @
8b270041
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#ifdef HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
# include <unistd.h>
# include <unistd.h>
#endif
#endif
#include <signal.h>
#define VLC_THREADS_UNINITIALIZED 0
#define VLC_THREADS_UNINITIALIZED 0
#define VLC_THREADS_PENDING 1
#define VLC_THREADS_PENDING 1
...
@@ -471,7 +472,25 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
...
@@ -471,7 +472,25 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
vlc_mutex_lock
(
&
p_this
->
object_lock
);
vlc_mutex_lock
(
&
p_this
->
object_lock
);
#if defined( LIBVLC_USE_PTHREAD )
#if defined( LIBVLC_USE_PTHREAD )
sigset_t
set
,
oldset
;
/* We really don't want signals to (literaly) interrupt our blocking I/O
* system calls. SIGPIPE is especially bad, as it can be caused by remote
* peers through connected sockets. Generally, we cannot know which signals
* are handled by the main program. Also, external LibVLC bindings tend not
* to setup a proper signal mask before invoking LibVLC.
* Hence, we hereby block all signals, except those for which blocking is
* undefined, as listed below. Note that SIGKILL and SIGSTOP need not be
* listed (see the documentation for pthread_sigmask) here. */
sigfillset
(
&
set
);
sigdelset
(
&
set
,
SIGFPE
);
sigdelset
(
&
set
,
SIGILL
);
sigdelset
(
&
set
,
SIGSEGV
);
sigdelset
(
&
set
,
SIGBUS
);
pthread_sigmask
(
SIG_BLOCK
,
&
set
,
&
oldset
);
i_ret
=
pthread_create
(
&
p_priv
->
thread_id
,
NULL
,
thread_entry
,
boot
);
i_ret
=
pthread_create
(
&
p_priv
->
thread_id
,
NULL
,
thread_entry
,
boot
);
pthread_sigmask
(
SIG_SETMASK
,
&
oldset
,
NULL
);
#ifndef __APPLE__
#ifndef __APPLE__
if
(
config_GetInt
(
p_this
,
"rt-priority"
)
>
0
)
if
(
config_GetInt
(
p_this
,
"rt-priority"
)
>
0
)
...
...
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