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
b44e7cc2
Commit
b44e7cc2
authored
Mar 14, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code simplification
parent
f49d815a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
22 deletions
+14
-22
src/vlc.c
src/vlc.c
+14
-22
No files found.
src/vlc.c
View file @
b44e7cc2
...
@@ -203,12 +203,6 @@ static void *SigHandler (void *data)
...
@@ -203,12 +203,6 @@ static void *SigHandler (void *data)
{
{
const
sigset_t
*
set
=
(
sigset_t
*
)
data
;
const
sigset_t
*
set
=
(
sigset_t
*
)
data
;
time_t
abort_time
=
0
;
time_t
abort_time
=
0
;
vlc_bool_t
b_die
=
VLC_FALSE
;
#ifdef __APPLE__
/* We really prefer the "force quit" menu item to act immediately */
b_die
=
VLC_TRUE
;
#endif
for
(;;)
for
(;;)
{
{
...
@@ -226,10 +220,10 @@ static void *SigHandler (void *data)
...
@@ -226,10 +220,10 @@ static void *SigHandler (void *data)
* signals to a libvlc structure having been destroyed */
* signals to a libvlc structure having been destroyed */
pthread_setcancelstate
(
PTHREAD_CANCEL_DISABLE
,
&
state
);
pthread_setcancelstate
(
PTHREAD_CANCEL_DISABLE
,
&
state
);
if
(
!
b_die
)
if
(
abort_time
==
0
)
{
{
b_die
=
VLC_TRUE
;
time
(
&
abort_time
)
;
abort_time
=
time
(
NULL
)
;
abort_time
+=
2
;
fprintf
(
stderr
,
"signal %d received, terminating vlc - do it "
fprintf
(
stderr
,
"signal %d received, terminating vlc - do it "
"again in case it gets stuck
\n
"
,
i_signal
);
"again in case it gets stuck
\n
"
,
i_signal
);
...
@@ -237,9 +231,10 @@ static void *SigHandler (void *data)
...
@@ -237,9 +231,10 @@ static void *SigHandler (void *data)
/* Acknowledge the signal received */
/* Acknowledge the signal received */
Kill
();
Kill
();
}
}
else
if
(
time
(
NULL
)
>
abort_time
+
2
)
else
{
if
(
time
(
NULL
)
<=
abort_time
)
/* If user asks again 1 or 2 seconds later, die badly */
{
/* If user asks again more than 2 seconds later, die badly */
pthread_sigmask
(
SIG_UNBLOCK
,
set
,
NULL
);
pthread_sigmask
(
SIG_UNBLOCK
,
set
,
NULL
);
fprintf
(
stderr
,
"user insisted too much, dying badly
\n
"
);
fprintf
(
stderr
,
"user insisted too much, dying badly
\n
"
);
abort
();
abort
();
...
@@ -250,18 +245,15 @@ static void *SigHandler (void *data)
...
@@ -250,18 +245,15 @@ static void *SigHandler (void *data)
}
}
#include <stdbool.h>
static
void
KillOnce
(
void
)
{
VLC_Die
(
0
);
}
static
void
Kill
(
void
)
static
void
Kill
(
void
)
{
{
static
pthread_mutex_t
lock
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_once_t
once
=
PTHREAD_ONCE_INIT
;
static
bool
killed
=
false
;;
pthread_once
(
KillOnce
);
pthread_mutex_lock
(
&
lock
);
if
(
!
killed
)
{
VLC_Die
(
0
);
killed
=
true
;
}
pthread_mutex_unlock
(
&
lock
);
}
}
#endif
#endif
...
...
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