Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1c3973d7
Commit
1c3973d7
authored
Dec 27, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: split darwin threading code from the generic posix implementation
parent
5c73acee
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
821 additions
and
32 deletions
+821
-32
src/Makefile.am
src/Makefile.am
+1
-1
src/darwin/thread.c
src/darwin/thread.c
+820
-0
src/posix/thread.c
src/posix/thread.c
+0
-31
No files found.
src/Makefile.am
View file @
1c3973d7
...
@@ -248,7 +248,7 @@ SOURCES_libvlc_darwin = \
...
@@ -248,7 +248,7 @@ SOURCES_libvlc_darwin = \
darwin/dirs.c
\
darwin/dirs.c
\
posix/filesystem.c
\
posix/filesystem.c
\
posix/plugin.c
\
posix/plugin.c
\
posix
/thread.c
\
darwin
/thread.c
\
posix/timer.c
\
posix/timer.c
\
darwin/specific.c
\
darwin/specific.c
\
posix/rand.c
\
posix/rand.c
\
...
...
src/darwin/thread.c
0 → 100644
View file @
1c3973d7
This diff is collapsed.
Click to expand it.
src/posix/thread.c
View file @
1c3973d7
...
@@ -49,9 +49,6 @@
...
@@ -49,9 +49,6 @@
#ifdef HAVE_EXECINFO_H
#ifdef HAVE_EXECINFO_H
# include <execinfo.h>
# include <execinfo.h>
#endif
#endif
#ifdef __APPLE__
# include <mach/mach_init.h>
/* mach_task_self in semaphores */
#endif
#if defined(__SunOS)
#if defined(__SunOS)
# include <sys/processor.h>
# include <sys/processor.h>
# include <sys/pset.h>
# include <sys/pset.h>
...
@@ -445,13 +442,8 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
...
@@ -445,13 +442,8 @@ int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex,
*/
*/
void
vlc_sem_init
(
vlc_sem_t
*
sem
,
unsigned
value
)
void
vlc_sem_init
(
vlc_sem_t
*
sem
,
unsigned
value
)
{
{
#if defined(__APPLE__)
if
(
unlikely
(
semaphore_create
(
mach_task_self
(),
sem
,
SYNC_POLICY_FIFO
,
value
)
!=
KERN_SUCCESS
))
abort
();
#else
if
(
unlikely
(
sem_init
(
sem
,
0
,
value
)))
if
(
unlikely
(
sem_init
(
sem
,
0
,
value
)))
abort
();
abort
();
#endif
}
}
/**
/**
...
@@ -461,17 +453,10 @@ void vlc_sem_destroy (vlc_sem_t *sem)
...
@@ -461,17 +453,10 @@ void vlc_sem_destroy (vlc_sem_t *sem)
{
{
int
val
;
int
val
;
#if defined(__APPLE__)
if
(
likely
(
semaphore_destroy
(
mach_task_self
(),
*
sem
)
==
KERN_SUCCESS
))
return
;
val
=
EINVAL
;
#else
if
(
likely
(
sem_destroy
(
sem
)
==
0
))
if
(
likely
(
sem_destroy
(
sem
)
==
0
))
return
;
return
;
val
=
errno
;
val
=
errno
;
#endif
VLC_THREAD_ASSERT
(
"destroying semaphore"
);
VLC_THREAD_ASSERT
(
"destroying semaphore"
);
}
}
...
@@ -484,17 +469,10 @@ int vlc_sem_post (vlc_sem_t *sem)
...
@@ -484,17 +469,10 @@ int vlc_sem_post (vlc_sem_t *sem)
{
{
int
val
;
int
val
;
#if defined(__APPLE__)
if
(
likely
(
semaphore_signal
(
*
sem
)
==
KERN_SUCCESS
))
return
0
;
val
=
EINVAL
;
#else
if
(
likely
(
sem_post
(
sem
)
==
0
))
if
(
likely
(
sem_post
(
sem
)
==
0
))
return
0
;
return
0
;
val
=
errno
;
val
=
errno
;
#endif
if
(
unlikely
(
val
!=
EOVERFLOW
))
if
(
unlikely
(
val
!=
EOVERFLOW
))
VLC_THREAD_ASSERT
(
"unlocking semaphore"
);
VLC_THREAD_ASSERT
(
"unlocking semaphore"
);
...
@@ -509,17 +487,10 @@ void vlc_sem_wait (vlc_sem_t *sem)
...
@@ -509,17 +487,10 @@ void vlc_sem_wait (vlc_sem_t *sem)
{
{
int
val
;
int
val
;
#if defined(__APPLE__)
if
(
likely
(
semaphore_wait
(
*
sem
)
==
KERN_SUCCESS
))
return
;
val
=
EINVAL
;
#else
do
do
if
(
likely
(
sem_wait
(
sem
)
==
0
))
if
(
likely
(
sem_wait
(
sem
)
==
0
))
return
;
return
;
while
((
val
=
errno
)
==
EINTR
);
while
((
val
=
errno
)
==
EINTR
);
#endif
VLC_THREAD_ASSERT
(
"locking semaphore"
);
VLC_THREAD_ASSERT
(
"locking semaphore"
);
}
}
...
@@ -625,9 +596,7 @@ void vlc_threads_setup (libvlc_int_t *p_libvlc)
...
@@ -625,9 +596,7 @@ void vlc_threads_setup (libvlc_int_t *p_libvlc)
* just once per process. */
* just once per process. */
if
(
!
initialized
)
if
(
!
initialized
)
{
{
#ifndef __APPLE__
if
(
var_InheritBool
(
p_libvlc
,
"rt-priority"
))
if
(
var_InheritBool
(
p_libvlc
,
"rt-priority"
))
#endif
{
{
rt_offset
=
var_InheritInteger
(
p_libvlc
,
"rt-offset"
);
rt_offset
=
var_InheritInteger
(
p_libvlc
,
"rt-offset"
);
rt_priorities
=
true
;
rt_priorities
=
true
;
...
...
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