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
36827a83
Commit
36827a83
authored
Jan 02, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use a static mutex for libvlc_wait on Win32 (fixes: #3219)
parent
52b3415e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
include/vlc_threads.h
include/vlc_threads.h
+1
-0
src/libvlc.c
src/libvlc.c
+10
-6
src/misc/w32thread.c
src/misc/w32thread.c
+2
-2
No files found.
include/vlc_threads.h
View file @
36827a83
...
...
@@ -106,6 +106,7 @@ typedef pthread_t vlc_thread_t;
typedef
pthread_mutex_t
vlc_mutex_t
;
#define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER
typedef
pthread_cond_t
vlc_cond_t
;
#define VLC_STATIC_COND PTHREAD_COND_INITIALIZER
typedef
sem_t
vlc_sem_t
;
typedef
pthread_rwlock_t
vlc_rwlock_t
;
typedef
pthread_key_t
vlc_threadvar_t
;
...
...
src/libvlc.c
View file @
36827a83
...
...
@@ -1182,7 +1182,15 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
return
ret
;
}
#ifndef WIN32
static
vlc_mutex_t
exit_lock
=
VLC_STATIC_MUTEX
;
static
vlc_cond_t
exiting
=
VLC_STATIC_COND
;
#else
extern
vlc_mutex_t
super_mutex
;
extern
vlc_cond_t
super_variable
;
# define exit_lock super_mutex
# define exiting super_variable
#endif
/**
* Waits until the LibVLC instance gets an exit signal. Normally, this happens
...
...
@@ -1190,11 +1198,9 @@ static vlc_mutex_t exit_lock = VLC_STATIC_MUTEX;
*/
void
libvlc_InternalWait
(
libvlc_int_t
*
p_libvlc
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_libvlc
);
vlc_mutex_lock
(
&
exit_lock
);
while
(
vlc_object_alive
(
p_libvlc
)
)
vlc_cond_wait
(
&
priv
->
exiting
,
&
exit_lock
);
vlc_cond_wait
(
&
exiting
,
&
exit_lock
);
vlc_mutex_unlock
(
&
exit_lock
);
}
...
...
@@ -1204,11 +1210,9 @@ void libvlc_InternalWait( libvlc_int_t *p_libvlc )
*/
void
libvlc_Quit
(
libvlc_int_t
*
p_libvlc
)
{
libvlc_priv_t
*
priv
=
libvlc_priv
(
p_libvlc
);
vlc_mutex_lock
(
&
exit_lock
);
vlc_object_kill
(
p_libvlc
);
vlc_cond_broadcast
(
&
priv
->
exiting
);
vlc_cond_broadcast
(
&
exiting
);
vlc_mutex_unlock
(
&
exit_lock
);
}
...
...
src/misc/w32thread.c
View file @
36827a83
...
...
@@ -140,8 +140,8 @@ DWORD WaitForMultipleObjectsEx (DWORD nCount, const HANDLE *lpHandles,
}
#endif
static
vlc_mutex_t
super_mutex
;
static
vlc_cond_t
super_variable
;
vlc_mutex_t
super_mutex
;
vlc_cond_t
super_variable
;
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDll
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
...
...
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