[vlc-devel] [PATCH 1/2] win32/inhibit: remove redundant semaphore
RĂ©mi Denis-Courmont
remi at remlab.net
Tue Dec 18 19:19:26 CET 2018
There are no observable side effects of waiting for it that are not
visible by waiting for vlc_clone() to return.
---
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;
}
--
2.20.0
More information about the vlc-devel
mailing list