Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
451
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
043d7ebf
Commit
043d7ebf
authored
4 years ago
by
Steve Lhomme
Browse files
Options
Downloads
Patches
Plain Diff
android: thread: remove unused detached thread support
Following
a10ac09d
parent
253cd988
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/android/thread.c
+7
-38
7 additions, 38 deletions
src/android/thread.c
with
7 additions
and
38 deletions
src/android/thread.c
+
7
−
38
View file @
043d7ebf
...
...
@@ -92,27 +92,6 @@ void vlc_threads_setup (libvlc_int_t *p_libvlc)
}
/* pthread */
static
void
clean_detached_thread
(
void
*
data
)
{
struct
vlc_thread
*
th
=
data
;
/* release thread handle */
free
(
th
);
}
static
void
*
detached_thread
(
void
*
data
)
{
vlc_thread_t
th
=
data
;
thread
=
th
;
vlc_cleanup_push
(
clean_detached_thread
,
th
);
th
->
entry
(
th
->
data
);
vlc_cleanup_pop
();
clean_detached_thread
(
th
);
return
NULL
;
}
static
void
*
joinable_thread
(
void
*
data
)
{
vlc_thread_t
th
=
data
;
...
...
@@ -122,7 +101,7 @@ static void *joinable_thread(void *data)
}
static
int
vlc_clone_attr
(
vlc_thread_t
*
th
,
void
*
(
*
entry
)
(
void
*
),
void
*
data
,
bool
detach
)
void
*
data
)
{
vlc_thread_t
thread
=
malloc
(
sizeof
(
*
thread
));
if
(
unlikely
(
thread
==
NULL
))
...
...
@@ -152,11 +131,9 @@ static int vlc_clone_attr (vlc_thread_t *th, void *(*entry) (void *),
pthread_attr_t
attr
;
pthread_attr_init
(
&
attr
);
pthread_attr_setdetachstate
(
&
attr
,
detach
?
PTHREAD_CREATE_DETACHED
:
PTHREAD_CREATE_JOINABLE
);
pthread_attr_setdetachstate
(
&
attr
,
PTHREAD_CREATE_JOINABLE
);
ret
=
pthread_create
(
&
thread
->
thread
,
&
attr
,
detach
?
detached_thread
:
joinable_thread
,
thread
);
ret
=
pthread_create
(
&
thread
->
thread
,
&
attr
,
joinable_thread
,
thread
);
pthread_attr_destroy
(
&
attr
);
pthread_sigmask
(
SIG_SETMASK
,
&
oldset
,
NULL
);
...
...
@@ -168,25 +145,17 @@ int vlc_clone (vlc_thread_t *th, void *(*entry) (void *), void *data,
int
priority
)
{
(
void
)
priority
;
return
vlc_clone_attr
(
th
,
entry
,
data
,
false
);
return
vlc_clone_attr
(
th
,
entry
,
data
);
}
void
vlc_join
(
vlc_thread_t
handle
,
void
**
result
)
{
int
val
=
pthread_join
(
handle
->
thread
,
result
);
VLC_THREAD_ASSERT
(
"joining thread"
);
clean_detached_thread
(
handle
);
}
int
vlc_clone_detach
(
vlc_thread_t
*
th
,
void
*
(
*
entry
)
(
void
*
),
void
*
data
,
int
priority
)
{
vlc_thread_t
dummy
;
if
(
th
==
NULL
)
th
=
&
dummy
;
struct
vlc_thread
*
th
=
handle
;
(
void
)
priority
;
re
turn
vlc_clone_attr
(
th
,
entry
,
data
,
true
);
/* release thread handle */
f
re
e
(
th
);
}
int
vlc_set_priority
(
vlc_thread_t
th
,
int
priority
)
...
...
This diff is collapsed.
Click to expand it.
Alexandre Janniaux
@alexandre-janniaux
mentioned in merge request
!803 (merged)
·
3 years ago
mentioned in merge request
!803 (merged)
mentioned in merge request !803
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment