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
0ac55db8
Commit
0ac55db8
authored
Aug 28, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signals: use the VLC thread API
parent
1b025556
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
modules/control/signals.c
modules/control/signals.c
+5
-6
No files found.
modules/control/signals.c
View file @
0ac55db8
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
# include "config.h"
# include "config.h"
#endif
#endif
#include <pthread.h>
#include <signal.h>
#include <signal.h>
#include <time.h>
#include <time.h>
...
@@ -46,7 +45,7 @@ vlc_module_end ();
...
@@ -46,7 +45,7 @@ vlc_module_end ();
struct
intf_sys_t
struct
intf_sys_t
{
{
pthread_t
thread
;
vlc_thread_t
thread
;
int
signum
;
int
signum
;
};
};
...
@@ -61,7 +60,7 @@ static int Open (vlc_object_t *obj)
...
@@ -61,7 +60,7 @@ static int Open (vlc_object_t *obj)
p_sys
->
signum
=
0
;
p_sys
->
signum
=
0
;
intf
->
p_sys
=
p_sys
;
intf
->
p_sys
=
p_sys
;
if
(
pthread_create
(
&
p_sys
->
thread
,
NULL
,
SigThread
,
obj
))
if
(
vlc_clone
(
&
p_sys
->
thread
,
SigThread
,
obj
,
VLC_THREAD_PRIORITY_LOW
))
{
{
free
(
p_sys
);
free
(
p_sys
);
intf
->
p_sys
=
NULL
;
intf
->
p_sys
=
NULL
;
...
@@ -77,14 +76,14 @@ static void Close (vlc_object_t *obj)
...
@@ -77,14 +76,14 @@ static void Close (vlc_object_t *obj)
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
obj
;
intf_thread_t
*
intf
=
(
intf_thread_t
*
)
obj
;
intf_sys_t
*
p_sys
=
intf
->
p_sys
;
intf_sys_t
*
p_sys
=
intf
->
p_sys
;
pthread
_cancel
(
p_sys
->
thread
);
vlc
_cancel
(
p_sys
->
thread
);
#ifdef __APPLE__
#ifdef __APPLE__
/* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
/* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
* cancellation point, so we throw a dummy quit signal to end
* cancellation point, so we throw a dummy quit signal to end
* sigwait() in the sigth thread */
* sigwait() in the sigth thread */
pthread_kill
(
p_sys
->
thread
,
SIGQUIT
);
pthread_kill
(
p_sys
->
thread
,
SIGQUIT
);
# endif
# endif
pthread
_join
(
p_sys
->
thread
,
NULL
);
vlc
_join
(
p_sys
->
thread
,
NULL
);
free
(
p_sys
);
free
(
p_sys
);
}
}
...
@@ -111,7 +110,7 @@ static void *SigThread (void *data)
...
@@ -111,7 +110,7 @@ static void *SigThread (void *data)
#ifdef __APPLE__
#ifdef __APPLE__
/* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
/* In Mac OS X up to 10.5 sigwait (among others) is not a pthread
* cancellation point */
* cancellation point */
pthread
_testcancel
();
vlc
_testcancel
();
#endif
#endif
vlc_object_lock
(
obj
);
vlc_object_lock
(
obj
);
...
...
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