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
d09ce38a
Commit
d09ce38a
authored
May 24, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead old object thread code
parent
eb3daf51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
110 deletions
+3
-110
src/libvlc.h
src/libvlc.h
+0
-13
src/misc/objects.c
src/misc/objects.c
+3
-13
src/misc/threads.c
src/misc/threads.c
+0
-84
No files found.
src/libvlc.h
View file @
d09ce38a
...
...
@@ -48,15 +48,6 @@ void system_End ( libvlc_int_t * );
/* This cannot be used as is from plugins yet: */
int
vlc_clone_detach
(
vlc_thread_t
*
,
void
*
(
*
)(
void
*
),
void
*
,
int
);
/* Hopefully, no need to export this. There is a new thread API instead. */
int
vlc_thread_create
(
vlc_object_t
*
,
void
*
(
*
)
(
vlc_object_t
*
),
int
)
VLC_USED
VLC_DEPRECATED
;
void
vlc_thread_join
(
vlc_object_t
*
)
VLC_DEPRECATED
;
#define vlc_thread_create( P_THIS, FUNC, PRIORITY ) \
vlc_thread_create( VLC_OBJECT(P_THIS), FUNC, PRIORITY )
#define vlc_thread_join( P_THIS ) \
vlc_thread_join( VLC_OBJECT(P_THIS) )
void
vlc_thread_cancel
(
vlc_object_t
*
);
int
vlc_object_waitpipe
(
vlc_object_t
*
obj
);
int
vlc_set_priority
(
vlc_thread_t
,
int
);
...
...
@@ -159,10 +150,6 @@ struct vlc_object_internals
vlc_mutex_t
var_lock
;
vlc_cond_t
var_wait
;
/* Thread properties, if any */
vlc_thread_t
thread_id
;
bool
b_thread
;
/* Objects thread synchronization */
int
pipes
[
2
];
...
...
src/misc/objects.c
View file @
d09ce38a
...
...
@@ -158,7 +158,6 @@ void *vlc_custom_create( vlc_object_t *p_this, size_t i_size,
vlc_spin_init
(
&
p_priv
->
ref_spin
);
p_priv
->
i_refcount
=
1
;
p_priv
->
pf_destructor
=
NULL
;
p_priv
->
b_thread
=
false
;
p_new
->
p_parent
=
NULL
;
p_priv
->
first
=
NULL
;
...
...
@@ -264,9 +263,6 @@ static void vlc_object_destroy( vlc_object_t *p_this )
if
(
p_priv
->
pf_destructor
)
p_priv
->
pf_destructor
(
p_this
);
/* Any thread must have been cleaned up at this point. */
assert
(
!
p_priv
->
b_thread
);
/* Destroy the associated variables. */
var_DestroyAll
(
p_this
);
...
...
@@ -390,7 +386,6 @@ void vlc_object_kill( vlc_object_t *p_this )
vlc_object_internals_t
*
priv
=
vlc_internals
(
p_this
);
int
fd
=
-
1
;
vlc_thread_cancel
(
p_this
);
vlc_mutex_lock
(
&
pipe_lock
);
if
(
!
p_this
->
b_die
)
{
...
...
@@ -797,7 +792,7 @@ static vlc_object_t *FindChildName (vlc_object_internals_t *priv,
static
void
PrintObject
(
vlc_object_internals_t
*
priv
,
const
char
*
psz_prefix
)
{
char
psz_refcount
[
20
],
psz_
thread
[
30
],
psz_
name
[
50
],
psz_parent
[
20
];
char
psz_refcount
[
20
],
psz_name
[
50
],
psz_parent
[
20
];
int
canc
=
vlc_savecancel
();
memset
(
&
psz_name
,
0
,
sizeof
(
psz_name
)
);
...
...
@@ -815,20 +810,15 @@ static void PrintObject( vlc_object_internals_t *priv,
if
(
priv
->
i_refcount
>
0
)
snprintf
(
psz_refcount
,
19
,
", %u refs"
,
priv
->
i_refcount
);
psz_thread
[
0
]
=
'\0'
;
if
(
priv
->
b_thread
)
snprintf
(
psz_thread
,
29
,
" (thread %lu)"
,
(
unsigned
long
)
priv
->
thread_id
);
psz_parent
[
0
]
=
'\0'
;
/* FIXME: need structure lock!!! */
if
(
vlc_externals
(
priv
)
->
p_parent
)
snprintf
(
psz_parent
,
19
,
", parent %p"
,
vlc_externals
(
priv
)
->
p_parent
);
printf
(
" %so %p %s%s%s%s
%s
\n
"
,
psz_prefix
,
printf
(
" %so %p %s%s%s%s
\n
"
,
psz_prefix
,
vlc_externals
(
priv
),
vlc_externals
(
priv
)
->
psz_object_type
,
psz_name
,
psz_
thread
,
psz_
refcount
,
psz_parent
);
psz_name
,
psz_refcount
,
psz_parent
);
vlc_restorecancel
(
canc
);
}
...
...
src/misc/threads.c
View file @
d09ce38a
...
...
@@ -30,91 +30,7 @@
#endif
#include <vlc_common.h>
#include "libvlc.h"
#include <assert.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if defined( LIBVLC_USE_PTHREAD )
# include <sched.h>
#endif
struct
vlc_thread_boot
{
void
*
(
*
entry
)
(
vlc_object_t
*
);
vlc_object_t
*
object
;
};
static
void
*
thread_entry
(
void
*
data
)
{
vlc_object_t
*
obj
=
((
struct
vlc_thread_boot
*
)
data
)
->
object
;
void
*
(
*
func
)
(
vlc_object_t
*
)
=
((
struct
vlc_thread_boot
*
)
data
)
->
entry
;
free
(
data
);
msg_Dbg
(
obj
,
"thread started"
);
func
(
obj
);
msg_Dbg
(
obj
,
"thread ended"
);
return
NULL
;
}
#undef vlc_thread_create
/*****************************************************************************
* vlc_thread_create: create a thread
*****************************************************************************
* Note that i_priority is only taken into account on platforms supporting
* userland real-time priority threads.
*****************************************************************************/
int
vlc_thread_create
(
vlc_object_t
*
p_this
,
void
*
(
*
func
)
(
vlc_object_t
*
),
int
i_priority
)
{
int
i_ret
;
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
struct
vlc_thread_boot
*
boot
=
malloc
(
sizeof
(
*
boot
));
if
(
boot
==
NULL
)
return
errno
;
boot
->
entry
=
func
;
boot
->
object
=
p_this
;
/* Make sure we don't re-create a thread if the object has already one */
assert
(
!
p_priv
->
b_thread
);
i_ret
=
vlc_clone
(
&
p_priv
->
thread_id
,
thread_entry
,
boot
,
i_priority
);
if
(
i_ret
==
0
)
p_priv
->
b_thread
=
true
;
else
{
errno
=
i_ret
;
msg_Err
(
p_this
,
"cannot create thread (%m)"
);
free
(
boot
);
}
return
i_ret
;
}
#undef vlc_thread_join
/*****************************************************************************
* vlc_thread_join: wait until a thread exits, inner version
*****************************************************************************/
void
vlc_thread_join
(
vlc_object_t
*
p_this
)
{
vlc_object_internals_t
*
p_priv
=
vlc_internals
(
p_this
);
vlc_join
(
p_priv
->
thread_id
,
NULL
);
p_priv
->
b_thread
=
false
;
}
void
vlc_thread_cancel
(
vlc_object_t
*
obj
)
{
vlc_object_internals_t
*
priv
=
vlc_internals
(
obj
);
if
(
priv
->
b_thread
)
vlc_cancel
(
priv
->
thread_id
);
}
/*** Global locks ***/
...
...
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