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
456
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
cc6e3d03
Commit
cc6e3d03
authored
17 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused object pointer from condition vars, mutexes and thread vars
parent
0774c40b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/vlc_modules_macros.h
+2
-2
2 additions, 2 deletions
include/vlc_modules_macros.h
include/vlc_threads.h
+0
-10
0 additions, 10 deletions
include/vlc_threads.h
include/vlc_threads_funcs.h
+8
-8
8 additions, 8 deletions
include/vlc_threads_funcs.h
src/misc/threads.c
+6
-16
6 additions, 16 deletions
src/misc/threads.c
with
16 additions
and
36 deletions
include/vlc_modules_macros.h
+
2
−
2
View file @
cc6e3d03
...
...
@@ -35,8 +35,8 @@
/**
* Current plugin ABI version
*/
# define MODULE_SYMBOL 0_9_0
f
# define MODULE_SUFFIX "__0_9_0
f
"
# define MODULE_SYMBOL 0_9_0
g
# define MODULE_SUFFIX "__0_9_0
g
"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
...
...
This diff is collapsed.
Click to expand it.
include/vlc_threads.h
+
0
−
10
View file @
cc6e3d03
...
...
@@ -133,8 +133,6 @@ typedef struct
HANDLE
mutex
;
/* Win95/98/ME implementation */
CRITICAL_SECTION
csection
;
vlc_object_t
*
p_this
;
}
vlc_mutex_t
;
typedef
struct
...
...
@@ -147,8 +145,6 @@ typedef struct
HANDLE
semaphore
;
CRITICAL_SECTION
csection
;
int
i_win9x_cv
;
vlc_object_t
*
p_this
;
}
vlc_cond_t
;
typedef
struct
...
...
@@ -167,16 +163,12 @@ typedef struct
{
int32_t
init
;
sem_id
lock
;
vlc_object_t
*
p_this
;
}
vlc_mutex_t
;
typedef
struct
{
int32_t
init
;
thread_id
thread
;
vlc_object_t
*
p_this
;
}
vlc_cond_t
;
typedef
struct
...
...
@@ -189,12 +181,10 @@ typedef pthread_t vlc_thread_t;
typedef
struct
{
pthread_mutex_t
mutex
;
vlc_object_t
*
p_this
;
}
vlc_mutex_t
;
typedef
struct
{
pthread_cond_t
cond
;
vlc_object_t
*
p_this
;
}
vlc_cond_t
;
typedef
struct
...
...
This diff is collapsed.
Click to expand it.
include/vlc_threads_funcs.h
+
8
−
8
View file @
cc6e3d03
...
...
@@ -35,12 +35,12 @@
/*****************************************************************************
* Function definitions
*****************************************************************************/
VLC_EXPORT
(
int
,
__vlc_mutex_init
,
(
vlc_object_t
*
,
vlc_mutex_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_mutex_init_recursive
,
(
vlc_object_t
*
,
vlc_mutex_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_mutex_init
,
(
vlc_mutex_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_mutex_init_recursive
,
(
vlc_mutex_t
*
)
);
VLC_EXPORT
(
void
,
__vlc_mutex_destroy
,
(
const
char
*
,
int
,
vlc_mutex_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_cond_init
,
(
vlc_object_t
*
,
vlc_cond_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_cond_init
,
(
vlc_cond_t
*
)
);
VLC_EXPORT
(
void
,
__vlc_cond_destroy
,
(
const
char
*
,
int
,
vlc_cond_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_threadvar_create
,
(
vlc_object_t
*
,
vlc_threadvar_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_threadvar_create
,
(
vlc_threadvar_t
*
)
);
VLC_EXPORT
(
int
,
__vlc_thread_create
,
(
vlc_object_t
*
,
const
char
*
,
int
,
const
char
*
,
void
*
(
*
)
(
void
*
),
int
,
vlc_bool_t
)
);
VLC_EXPORT
(
int
,
__vlc_thread_set_priority
,
(
vlc_object_t
*
,
const
char
*
,
int
,
int
)
);
VLC_EXPORT
(
void
,
__vlc_thread_ready
,
(
vlc_object_t
*
)
);
...
...
@@ -62,13 +62,13 @@ VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, const char *, int ) );
* vlc_mutex_init: initialize a mutex
*****************************************************************************/
#define vlc_mutex_init( P_THIS, P_MUTEX ) \
__vlc_mutex_init(
VLC_OBJECT(P_THIS),
P_MUTEX )
__vlc_mutex_init( P_MUTEX )
/*****************************************************************************
* vlc_mutex_init: initialize a recursive mutex (Don't use it)
*****************************************************************************/
#define vlc_mutex_init_recursive( P_THIS, P_MUTEX ) \
__vlc_mutex_init_recursive(
VLC_OBJECT(P_THIS),
P_MUTEX )
__vlc_mutex_init_recursive( P_MUTEX )
/*****************************************************************************
* vlc_mutex_lock: lock a mutex
...
...
@@ -152,7 +152,7 @@ static inline void __vlc_mutex_unlock( const char * psz_file, int i_line,
* vlc_cond_init: initialize a condition
*****************************************************************************/
#define vlc_cond_init( P_THIS, P_COND ) \
__vlc_cond_init(
VLC_OBJECT(P_THIS),
P_COND )
__vlc_cond_init( P_COND )
/*****************************************************************************
* vlc_cond_signal: start a thread on condition completion
...
...
@@ -497,7 +497,7 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
* vlc_threadvar_create: create a thread-local variable
*****************************************************************************/
#define vlc_threadvar_create( PTHIS, P_TLS ) \
__vlc_threadvar_create(
PTHIS,
P_TLS )
__vlc_threadvar_create( P_TLS )
/*****************************************************************************
* vlc_threadvar_set: create: set the value of a thread-local variable
...
...
This diff is collapsed.
Click to expand it.
src/misc/threads.c
+
6
−
16
View file @
cc6e3d03
...
...
@@ -253,10 +253,8 @@ int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
/*****************************************************************************
* vlc_mutex_init: initialize a mutex
*****************************************************************************/
int
__vlc_mutex_init
(
vlc_object_t
*
p_this
,
vlc_mutex_t
*
p_mutex
)
int
__vlc_mutex_init
(
vlc_mutex_t
*
p_mutex
)
{
p_mutex
->
p_this
=
p_this
;
#if defined( UNDER_CE )
InitializeCriticalSection
(
&
p_mutex
->
csection
);
return
0
;
...
...
@@ -327,10 +325,8 @@ int __vlc_mutex_init( vlc_object_t *p_this, vlc_mutex_t *p_mutex )
/*****************************************************************************
* vlc_mutex_init: initialize a recursive mutex (Do not use)
*****************************************************************************/
int
__vlc_mutex_init_recursive
(
vlc_object_t
*
p_this
,
vlc_mutex_t
*
p_mutex
)
int
__vlc_mutex_init_recursive
(
vlc_mutex_t
*
p_mutex
)
{
p_mutex
->
p_this
=
p_this
;
#if defined( WIN32 )
/* Create mutex returns a recursive mutex */
p_mutex
->
mutex
=
CreateMutex
(
0
,
FALSE
,
0
);
...
...
@@ -353,9 +349,7 @@ int __vlc_mutex_init_recursive( vlc_object_t *p_this, vlc_mutex_t *p_mutex )
pthread_mutexattr_destroy
(
&
attr
);
return
(
i_result
);
#else
msg_Err
(
p_this
,
"no recursive mutex found. Falling back to regular mutex.
\n
"
"Expect hangs
\n
"
)
return
__vlc_mutex_init
(
p_this
,
p_mutex
);
# error Unimplemented!
#endif
}
...
...
@@ -390,10 +384,8 @@ void __vlc_mutex_destroy( const char * psz_file, int i_line, vlc_mutex_t *p_mute
/*****************************************************************************
* vlc_cond_init: initialize a condition
*****************************************************************************/
int
__vlc_cond_init
(
vlc_object_t
*
p_this
,
vlc_cond_t
*
p_condvar
)
int
__vlc_cond_init
(
vlc_cond_t
*
p_condvar
)
{
p_condvar
->
p_this
=
p_this
;
#if defined( UNDER_CE )
/* Initialize counter */
p_condvar
->
i_waiting_threads
=
0
;
...
...
@@ -516,14 +508,12 @@ void __vlc_cond_destroy( const char * psz_file, int i_line, vlc_cond_t *p_condva
/*****************************************************************************
* vlc_tls_create: create a thread-local variable
*****************************************************************************/
int
__vlc_threadvar_create
(
vlc_object_t
*
p_this
,
vlc_threadvar_t
*
p_tls
)
int
__vlc_threadvar_create
(
vlc_threadvar_t
*
p_tls
)
{
int
i_ret
=
-
1
;
(
void
)
p_this
;
#if defined( HAVE_KERNEL_SCHEDULER_H )
msg_Err
(
p_this
,
"TLS not implemented"
);
i_ret
VLC_EGENERIC
;
# error Unimplemented!
#elif defined( UNDER_CE ) || defined( WIN32 )
#elif defined( WIN32 )
p_tls
->
handle
=
TlsAlloc
();
...
...
This diff is collapsed.
Click to expand it.
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