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

thread: remove vlc_mutex_destroy()

parent e7eb4a46
......@@ -281,10 +281,6 @@ public:
{
vlc_mutex_init( &m_mutex );
}
~mutex()
{
vlc_mutex_destroy( &m_mutex );
}
mutex( const mutex& ) = delete;
mutex& operator=( const mutex& ) = delete;
......
......@@ -344,13 +344,6 @@ VLC_API void vlc_mutex_init(vlc_mutex_t *);
*/
VLC_API void vlc_mutex_init_recursive(vlc_mutex_t *);
/**
* Deinitializes a mutex.
*
* The mutex must not be locked, otherwise behaviour is undefined.
*/
VLC_API void vlc_mutex_destroy(vlc_mutex_t *);
/**
* Acquires a mutex.
*
......
......@@ -93,7 +93,6 @@ void libvlc_release( libvlc_instance_t *p_instance )
if( refs == 0 )
{
vlc_mutex_destroy( lock );
libvlc_Quit( p_instance->p_libvlc_int );
libvlc_InternalCleanup( p_instance->p_libvlc_int );
libvlc_InternalDestroy( p_instance->p_libvlc_int );
......
......@@ -90,8 +90,6 @@ void libvlc_event_manager_init(libvlc_event_manager_t *em, void *obj)
void libvlc_event_manager_destroy(libvlc_event_manager_t *em)
{
vlc_mutex_destroy(&em->lock);
for (size_t i = 0; i < vlc_array_count(&em->listeners); i++)
free(vlc_array_item_at_index(&em->listeners, i));
......
......@@ -563,8 +563,6 @@ void libvlc_media_release( libvlc_media_t *p_md )
input_item_Release( p_md->p_input_item );
vlc_cond_destroy( &p_md->parsed_cond );
vlc_mutex_destroy( &p_md->parsed_lock );
vlc_mutex_destroy( &p_md->subitems_lock );
/* Construct the event */
libvlc_event_t event;
......
......@@ -202,8 +202,6 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
libvlc_media_release( p_md );
}
vlc_mutex_destroy( &p_mlist->object_lock );
vlc_mutex_destroy( &p_mlist->refcount_lock );
vlc_array_clear( &p_mlist->items );
libvlc_release( p_mlist->p_libvlc_instance );
......
......@@ -498,8 +498,6 @@ libvlc_media_list_player_new(libvlc_instance_t * p_instance)
error:
libvlc_event_manager_destroy(&p_mlp->event_manager);
vlc_cond_destroy(&p_mlp->seek_pending);
vlc_mutex_destroy(&p_mlp->mp_callback_lock);
vlc_mutex_destroy(&p_mlp->object_lock);
free(p_mlp);
return NULL;
}
......@@ -544,9 +542,6 @@ void libvlc_media_list_player_release(libvlc_media_list_player_t * p_mlp)
libvlc_event_manager_destroy(&p_mlp->event_manager);
vlc_cond_destroy(&p_mlp->seek_pending);
vlc_mutex_destroy(&p_mlp->mp_callback_lock);
vlc_mutex_destroy(&p_mlp->object_lock);
free(p_mlp->current_playing_item_path);
free(p_mlp);
}
......
......@@ -476,10 +476,8 @@ static void unref_subpicture_updater(bluray_spu_updater_sys_t *p_sys)
p_sys->p_overlay = NULL;
vlc_mutex_unlock(&p_sys->lock);
if (refs < 1) {
vlc_mutex_destroy(&p_sys->lock);
if (refs < 1)
free(p_sys);
}
}
/* Get a 3 char code
......@@ -1131,10 +1129,6 @@ static void blurayClose(vlc_object_t *object)
ARRAY_RESET(p_sys->events_delayed);
vlc_mutex_destroy(&p_sys->pl_info_lock);
vlc_mutex_destroy(&p_sys->bdj.lock);
vlc_mutex_destroy(&p_sys->read_block_lock);
free(p_sys->psz_bd_path);
}
......@@ -1576,7 +1570,6 @@ static void bluray_esOutDestroy(es_out_t *p_out)
for (size_t i = 0; i < vlc_array_count(&esout_priv->es); ++i)
es_pair_Delete(vlc_array_item_at_index(&esout_priv->es, i));
vlc_array_clear(&esout_priv->es);
vlc_mutex_destroy(&esout_priv->lock);
free(esout_priv);
}
......@@ -1804,7 +1797,6 @@ static void blurayCloseOverlay(demux_t *p_demux, int plane)
/* no references to this overlay exist in vo anymore */
es_out_Control(p_sys->p_out, BLURAY_ES_OUT_CONTROL_DELETE_OVERLAY, plane);
vlc_mutex_destroy(&ov->lock);
subpicture_region_ChainDelete(ov->p_regions);
free(ov);
......
......@@ -782,7 +782,6 @@ static void Close(vlc_object_t *p_this)
if (sys->delegate)
sys->delegate->Release();
vlc_mutex_destroy(&sys->pts_lock);
free(sys);
}
......
......@@ -816,7 +816,6 @@ static void CommonClose( vlc_object_t *p_this, access_sys_t *p_sys )
vlc_delete_all( p_sys->pp_streams );
vlc_mutex_destroy( &p_sys->lock );
vlc_cond_destroy( &p_sys->wait );
vlc_mta_release( p_this );
......
......@@ -321,7 +321,6 @@ BDAOutput::BDAOutput( vlc_object_t *p_access ) :
BDAOutput::~BDAOutput()
{
Empty();
vlc_mutex_destroy( &lock );
vlc_cond_destroy( &wait );
}
......
......@@ -238,7 +238,6 @@ static void Close( vlc_object_t *p_this )
raw1394_iso_shutdown( p_sys->p_raw1394 );
vlc_join( p_sys->p_ev->thread, NULL );
vlc_mutex_destroy( &p_sys->p_ev->lock );
/* Cleanup frame data */
if( p_sys->p_ev->p_frame )
......@@ -256,8 +255,6 @@ static void Close( vlc_object_t *p_this )
raw1394_destroy_handle( p_sys->p_raw1394 );
AVCClose( p_access );
vlc_mutex_destroy( &p_sys->lock );
}
/*****************************************************************************
......
......@@ -487,8 +487,6 @@ static void Close( vlc_object_t *p_this )
/* Stop still image handler */
if( p_sys->still.b_created )
vlc_timer_destroy( p_sys->still.timer );
vlc_mutex_destroy( &p_sys->still.lock );
vlc_mutex_destroy( &p_sys->event_lock );
for( int i = 0; i < PS_TK_COUNT; i++ )
{
......
......@@ -740,7 +740,6 @@ static void vlc_h2_conn_destroy(struct vlc_h2_conn *conn)
vlc_cancel(conn->thread);
vlc_join(conn->thread, NULL);
vlc_mutex_destroy(&conn->lock);
vlc_h2_output_destroy(conn->out);
vlc_tls_Shutdown(conn->conn.tls, true);
......@@ -796,7 +795,6 @@ struct vlc_http_conn *vlc_h2_conn_create(void *ctx, struct vlc_tls *tls)
|| vlc_clone(&conn->thread, vlc_h2_recv_thread, conn,
VLC_THREAD_PRIORITY_INPUT))
{
vlc_mutex_destroy(&conn->lock);
vlc_h2_output_destroy(conn->out);
goto error;
}
......
......@@ -323,7 +323,6 @@ struct vlc_h2_output *vlc_h2_output_create(struct vlc_tls *tls, bool client)
if (vlc_clone(&out->thread, cb, out, VLC_THREAD_PRIORITY_INPUT))
{
vlc_cond_destroy(&out->wait);
vlc_mutex_destroy(&out->lock);
free(out);
out = NULL;
}
......@@ -341,7 +340,6 @@ void vlc_h2_output_destroy(struct vlc_h2_output *out)
vlc_join(out->thread, NULL);
vlc_cond_destroy(&out->wait);
vlc_mutex_destroy(&out->lock);
/* Flush queues in case the thread was terminated within poll() and some
* packets were still queued. */
vlc_h2_output_flush_unlocked(out);
......
......@@ -110,7 +110,6 @@ int MMSTUOpen( stream_t *p_access )
{
msg_Err( p_access, "invalid server name" );
vlc_UrlClean( &p_sys->url );
vlc_mutex_destroy( &p_sys->lock_netwrite );
free( p_sys );
return VLC_EGENERIC;
}
......@@ -147,7 +146,6 @@ int MMSTUOpen( stream_t *p_access )
{
msg_Err( p_access, "cannot connect to server" );
vlc_UrlClean( &p_sys->url );
vlc_mutex_destroy( &p_sys->lock_netwrite );
free( p_sys );
return VLC_EGENERIC;
}
......
......@@ -1035,8 +1035,6 @@ static void Clean( stream_t *p_access )
free(p_sys->flow->buffer);
free(p_sys->flow);
}
vlc_mutex_destroy( &p_sys->lock );
}
static void Close(vlc_object_t *p_this)
......
......@@ -390,8 +390,6 @@ static int Open(vlc_object_t *p_this)
return VLC_SUCCESS;
failed:
vlc_mutex_destroy( &p_sys->lock );
if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
......@@ -403,8 +401,6 @@ static void Close(vlc_object_t *p_this)
stream_t *p_stream = (stream_t*)p_this;
stream_sys_t *p_sys = p_stream->p_sys;
vlc_mutex_destroy( &p_sys->lock );
srt_epoll_remove_usock( p_sys->i_poll_id, p_sys->sock );
srt_close( p_sys->sock );
srt_epoll_release( p_sys->i_poll_id );
......
......@@ -714,8 +714,6 @@ static void Clean( sout_access_out_t *p_access )
free(p_sys->flow);
}
vlc_mutex_destroy( &p_sys->lock );
vlc_mutex_destroy( &p_sys->fd_lock );
if (p_sys->p_pktbuffer)
block_Release(p_sys->p_pktbuffer);
}
......
......@@ -402,8 +402,6 @@ static int Open( vlc_object_t *p_this )
return VLC_SUCCESS;
failed:
vlc_mutex_destroy( &p_sys->lock );
if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
......@@ -415,8 +413,6 @@ static void Close( vlc_object_t * p_this )
sout_access_out_t *p_access = (sout_access_out_t*)p_this;
sout_access_out_sys_t *p_sys = p_access->p_sys;
vlc_mutex_destroy( &p_sys->lock );
srt_epoll_remove_usock( p_sys->i_poll_id, p_sys->sock );
srt_close( p_sys->sock );
srt_epoll_release( p_sys->i_poll_id );
......
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