[vlc-commits] win32/inhibit: remove redundant semaphore
Rémi Denis-Courmont
git at videolan.org
Wed Dec 19 16:53:46 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Dec 18 20:19:26 2018 +0200| [4c916f42d75f6f3c9faebecf990ce92048c4a800] | committer: Steve Lhomme
win32/inhibit: remove redundant semaphore
There are no observable side effects of waiting for it that are not
visible by waiting for vlc_clone() to return.
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c916f42d75f6f3c9faebecf990ce92048c4a800
---
modules/video_output/win32/inhibit.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/modules/video_output/win32/inhibit.c b/modules/video_output/win32/inhibit.c
index 77e21f0984..893a809540 100644
--- a/modules/video_output/win32/inhibit.c
+++ b/modules/video_output/win32/inhibit.c
@@ -31,7 +31,6 @@
struct vlc_inhibit_sys
{
- vlc_sem_t sem;
vlc_mutex_t mutex;
vlc_cond_t cond;
vlc_thread_t thread;
@@ -61,7 +60,6 @@ static void* Run(void* obj)
vlc_inhibit_sys_t *sys = ih->p_sys;
EXECUTION_STATE prev_state = ES_CONTINUOUS;
- vlc_sem_post(&sys->sem);
while (true)
{
unsigned int mask;
@@ -97,7 +95,6 @@ static void CloseInhibit (vlc_object_t *obj)
vlc_join(sys->thread, NULL);
vlc_cond_destroy(&sys->cond);
vlc_mutex_destroy(&sys->mutex);
- vlc_sem_destroy(&sys->sem);
}
static int OpenInhibit (vlc_object_t *obj)
@@ -108,7 +105,6 @@ static int OpenInhibit (vlc_object_t *obj)
if (unlikely(ih->p_sys == NULL))
return VLC_ENOMEM;
- vlc_sem_init(&sys->sem, 0);
vlc_mutex_init(&sys->mutex);
vlc_cond_init(&sys->cond);
sys->signaled = false;
@@ -118,12 +114,9 @@ static int OpenInhibit (vlc_object_t *obj)
{
vlc_cond_destroy(&sys->cond);
vlc_mutex_destroy(&sys->mutex);
- vlc_sem_destroy(&sys->sem);
return VLC_EGENERIC;
}
- vlc_sem_wait(&sys->sem);
-
ih->inhibit = Inhibit;
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list