Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
c13d67b8
Commit
c13d67b8
authored
Mar 01, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix race condition and simplify SigHandler
Missing piece pointed out by Pierre d'H.
parent
1d589191
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
src/vlc.c
src/vlc.c
+19
-14
No files found.
src/vlc.c
View file @
c13d67b8
...
...
@@ -39,19 +39,14 @@
#include <windows.h>
extern
void
__wgetmainargs
(
int
*
argc
,
wchar_t
***
wargv
,
wchar_t
***
wenviron
,
int
expand_wildcards
,
int
*
startupinfo
);
static
inline
void
Kill
(
void
)
{
}
#else
# include <signal.h>
# include <time.h>
# include <pthread.h>
# include <stdbool.h>
static
struct
{
bool
flag
;
pthread_mutex_t
lock
;
}
live
=
{
true
,
PTHREAD_MUTEX_INITIALIZER
};
static
void
Kill
(
void
);
static
void
*
SigHandler
(
void
*
set
);
#endif
...
...
@@ -175,6 +170,8 @@ int main( int i_argc, char *ppsz_argv[] )
/* Finish the threads */
VLC_CleanUp
(
0
);
Kill
();
/* Destroy the libvlc structure */
VLC_Destroy
(
0
);
...
...
@@ -218,13 +215,7 @@ static void *SigHandler (void *data)
"again in case it gets stuck
\n
"
,
i_signal
);
/* Acknowledge the signal received */
pthread_mutex_lock
(
&
live
.
lock
);
if
(
live
.
flag
)
{
VLC_Die
(
0
);
live
.
flag
=
false
;
}
pthread_mutex_unlock
(
&
live
.
lock
);
Kill
();
}
else
if
(
time
(
NULL
)
>
abort_time
+
2
)
{
...
...
@@ -237,6 +228,20 @@ static void *SigHandler (void *data)
}
/* Never reached */
}
static
void
KillOnce
(
void
)
{
VLC_Die
(
0
);
}
static
void
Kill
(
void
)
{
static
pthread_once_t
once
=
PTHREAD_ONCE_INIT
;
pthread_once
(
&
once
,
KillOnce
);
}
#endif
#if defined(UNDER_CE)
...
...
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