Commit 6d324add authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

thread: remove vlc_sem_destroy()

This has become a useless no-op on all platforms.
parent cf1e3e99
......@@ -376,7 +376,6 @@ public:
}
~semaphore()
{
vlc_sem_destroy( &m_sem );
}
semaphore( const semaphore& ) = delete;
......
......@@ -569,11 +569,6 @@ int vlc_cond_timedwait_daytime(vlc_cond_t *, vlc_mutex_t *, time_t);
*/
VLC_API void vlc_sem_init(vlc_sem_t *, unsigned count);
/**
* Deinitializes a semaphore.
*/
VLC_API void vlc_sem_destroy(vlc_sem_t *);
/**
* Increments the value of a semaphore.
*
......
......@@ -134,7 +134,6 @@ int main(void)
out = vlc_h2_output_create(&fake_tls, expect_hello = true);
assert(out != NULL);
vlc_h2_output_destroy(out);
vlc_sem_destroy(&rx);
/* Success */
vlc_sem_init(&rx, 0);
......@@ -156,7 +155,6 @@ int main(void)
assert(vlc_h2_output_send(out, frame(9)) == 0);
vlc_h2_output_destroy(out);
vlc_sem_destroy(&rx);
/* Failure */
send_failure = true;
......@@ -172,7 +170,6 @@ int main(void)
assert(vlc_h2_output_send(out, frame(0)) == -1);
assert(vlc_h2_output_send_prio(out, frame(0)) == -1);
vlc_h2_output_destroy(out);
vlc_sem_destroy(&rx);
/* Failure during hello */
vlc_sem_init(&rx, 0);
......@@ -186,7 +183,6 @@ int main(void)
assert(vlc_h2_output_send(out, frame(0)) == -1);
assert(vlc_h2_output_send_prio(out, frame(0)) == -1);
vlc_h2_output_destroy(out);
vlc_sem_destroy(&rx);
return 0;
}
......@@ -134,7 +134,6 @@ ca_Close(audio_output_t *p_aout)
{
struct aout_sys_common *p_sys = (struct aout_sys_common *) p_aout->sys;
vlc_sem_destroy(&p_sys->flush_sem);
lock_destroy(p_sys);
}
......
......@@ -100,13 +100,11 @@ static int Open( vlc_object_t *p_this )
if( vlc_clone( &p_intf->p_sys->thread, Run, p_intf,
VLC_THREAD_PRIORITY_LOW ) )
{
vlc_sem_destroy( &p_intf->p_sys->init_wait );
free( p_intf->p_sys );
return VLC_EGENERIC;
}
vlc_sem_wait( &p_intf->p_sys->init_wait );
vlc_sem_destroy( &p_intf->p_sys->init_wait );
if( p_intf->p_sys->b_error )
{
......
......@@ -449,7 +449,6 @@ static void conv_flush(filter_t * p_filter)
pic_fifo_release_all(&sys->ret_pics);
// Reset sem values - easiest & most reliable way is to just kill & re-init
vlc_sem_destroy(&sys->sem);
vlc_sem_init(&sys->sem, 0);
sys->pic_n = 0;
......@@ -783,7 +782,6 @@ void CloseConverter(vlc_object_t * obj)
if (sys->dec_dev)
vlc_decoder_device_Release(sys->dec_dev);
vlc_sem_destroy(&sys->sem);
vlc_mutex_destroy(&sys->lock);
p_filter->p_sys = NULL;
......
......@@ -313,7 +313,6 @@ Open(vlc_object_t *p_this)
vlc_sem_wait_i11e(&watch_data.sem);
g_bus_unwatch_name(i_id);
vlc_sem_destroy(&watch_data.sem);
if (!watch_data.b_running)
return VLC_EGENERIC;
......
......@@ -112,7 +112,6 @@ PictureStreamOutputBuffer::PictureStreamOutputBuffer()
PictureStreamOutputBuffer::~PictureStreamOutputBuffer()
{
vlc_sem_destroy(&pool_semaphore);
}
void * PictureStreamOutputBuffer::Dequeue()
......
......@@ -444,7 +444,6 @@ void transcode_encoder_video_close( transcode_encoder_t *p_enc )
p_enc->p_encoder->p_module = NULL;
vlc_cond_destroy( &p_enc->cond );
vlc_sem_destroy( &p_enc->picture_pool_has_room );
}
int transcode_encoder_video_open( transcode_encoder_t *p_enc,
......@@ -474,7 +473,6 @@ int transcode_encoder_video_open( transcode_encoder_t *p_enc,
if( vlc_clone( &p_enc->thread, EncoderThread, p_enc, p_cfg->video.threads.i_priority ) )
{
vlc_cond_destroy( &p_enc->cond );
vlc_sem_destroy( &p_enc->picture_pool_has_room );
module_unneed( p_enc->p_encoder, p_enc->p_encoder->p_module );
p_enc->p_encoder->p_module = NULL;
return VLC_EGENERIC;
......
......@@ -127,7 +127,6 @@ static void vlc_vidsplit_Close(vout_display_t *vd)
vout_window_Disable(part->window);
vout_window_Delete(part->window);
vlc_sem_destroy(&part->lock);
}
module_unneed(&sys->splitter, sys->splitter.p_module);
......@@ -295,7 +294,6 @@ static int vlc_vidsplit_Open(vout_display_t *vd,
if (display == NULL) {
vout_window_Disable(part->window);
vout_window_Delete(part->window);
vlc_sem_destroy(&part->lock);
splitter->i_output = i;
vlc_vidsplit_Close(vd);
return VLC_EGENERIC;
......
......@@ -470,7 +470,6 @@ static void Close(vout_window_t *wnd)
if (sys->hwnd)
PostMessage( sys->hwnd, WM_CLOSE, 0, 0 );
vlc_join(sys->thread, NULL);
vlc_sem_destroy( &sys->ready );
free(atomic_load(&sys->pwz_title));
HINSTANCE hInstance = GetModuleHandle(NULL);
......
......@@ -259,7 +259,6 @@ int vlc_clone (vlc_thread_t *th, void *(*entry) (void *), void *data,
void vlc_join (vlc_thread_t handle, void **result)
{
vlc_sem_wait (&handle->finished);
vlc_sem_destroy (&handle->finished);
int val = pthread_join (handle->thread, result);
VLC_THREAD_ASSERT ("joining thread");
......
......@@ -684,7 +684,6 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
}
vlc_player_Unlock(player);
vlc_player_Delete(player);
vlc_sem_destroy( &sem_preparse );
}
......
......@@ -519,7 +519,6 @@ vlc_dialog_wait_question
vlc_dialog_wait_question_va
vlc_ext_dialog_update
vlc_sem_init
vlc_sem_destroy
vlc_sem_post
vlc_sem_wait
vlc_control_cancel
......
......@@ -69,10 +69,7 @@ int vlc_getaddrinfo_i11e(const char *name, unsigned port,
int val = getaddrinfo_a(GAI_NOWAIT, &(struct gaicb *){ &req }, 1, &sev);
if (val)
{
vlc_sem_destroy(&done);
return val;
}
vlc_sem_wait_i11e(&done);
......@@ -83,7 +80,6 @@ int vlc_getaddrinfo_i11e(const char *name, unsigned port,
val = gai_error(&req);
assert(val != EAI_INPROGRESS);
vlc_sem_destroy(&done);
if (val == 0)
*res = req.ar_result;
......
......@@ -403,11 +403,6 @@ void vlc_sem_init (vlc_sem_t *sem, unsigned value)
atomic_init(&sem->value, value);
}
void vlc_sem_destroy (vlc_sem_t *sem)
{
(void) sem;
}
int vlc_sem_post (vlc_sem_t *sem)
{
unsigned exp = atomic_load_explicit(&sem->value, memory_order_relaxed);
......
......@@ -76,16 +76,12 @@ int vlc_getaddrinfo_i11e(const char *name, unsigned port,
vlc_sem_init(&req.done, 0);
if (vlc_clone(&th, vlc_gai_thread, &req, VLC_THREAD_PRIORITY_LOW))
{
vlc_sem_destroy(&req.done);
return EAI_SYSTEM;
}
vlc_sem_wait_i11e(&req.done);
vlc_cancel(th);
vlc_join(th, NULL);
vlc_sem_destroy(&req.done);
return req.error;
}
......@@ -207,6 +207,5 @@ int main (void)
vlc_close(fds[1]);
vlc_close(fds[0]);
vlc_sem_destroy(&sem);
return 0;
}
......@@ -78,8 +78,6 @@ static inline bool vlc_mta_acquire( vlc_object_t *p_parent )
p_mta->i_refcount = 1;
if ( vlc_clone( &p_mta->thread, MtaMainLoop, p_mta, VLC_THREAD_PRIORITY_LOW ) )
{
vlc_sem_destroy( &p_mta->release_sem );
vlc_sem_destroy( &p_mta->ready_sem );
free( p_mta );
p_mta = NULL;
vlc_global_unlock( VLC_MTA_MUTEX );
......@@ -116,8 +114,6 @@ static inline void vlc_mta_release( vlc_object_t* p_parent )
vlc_join( p_mta->thread, NULL );
vlc_sem_destroy( &p_mta->release_sem );
vlc_sem_destroy( &p_mta->ready_sem );
free( p_mta );
}
}
......
......@@ -116,7 +116,6 @@ static void test_media_preparsed(libvlc_instance_t *vlc, const char *path,
// Wait for preparsed event
vlc_sem_wait (&sem);
vlc_sem_destroy (&sem);
// We are good, now check Elementary Stream info.
assert (libvlc_media_get_parsed_status(media) == i_expected_status);
......@@ -173,7 +172,6 @@ static void test_input_metadata_timeout(libvlc_instance_t *vlc, int timeout,
vlc_sem_wait(&sem);
input_item_Release(p_item);
vlc_sem_destroy(&sem);
vlc_close(p_pipe[0]);
vlc_close(p_pipe[1]);
}
......@@ -267,8 +265,6 @@ static void test_media_subitems_media(libvlc_media_t *media, bool play,
vlc_sem_wait (&sem);
}
vlc_sem_destroy (&sem);
if (!b_items_expected)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment