[vlc-commits] Rename vlc_assert_locked to vlc_mutex_assert

Rémi Denis-Courmont git at videolan.org
Sun Oct 21 13:01:33 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 20 23:04:11 2018 +0300| [120232dd64931f99f3ad69c991e876dca916c077] | committer: Rémi Denis-Courmont

Rename vlc_assert_locked to vlc_mutex_assert

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=120232dd64931f99f3ad69c991e876dca916c077
---

 src/audio_output/output.c       |  2 +-
 src/input/decoder.c             |  6 +++---
 src/input/es_out_timeshift.c    |  2 +-
 src/input/item.c                |  4 ++--
 src/input/resource.c            |  2 +-
 src/libvlc.h                    |  2 --
 src/misc/background_worker.c    | 10 +++++-----
 src/misc/fifo.c                 |  6 +++---
 src/modules/bank.c              |  2 +-
 src/playlist/control.c          |  2 +-
 src/video_output/video_output.c |  2 +-
 11 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 4567a40996..019797c5ef 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -48,7 +48,7 @@ static void aout_OutputAssertLocked (audio_output_t *aout)
 {
     aout_owner_t *owner = aout_owner (aout);
 
-    vlc_assert_locked (&owner->lock);
+    vlc_mutex_assert (&owner->lock);
 }
 
 static void aout_Destructor( vlc_object_t * p_this );
diff --git a/src/input/decoder.c b/src/input/decoder.c
index b39c704bfa..4c332471ef 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -270,7 +270,7 @@ static void DecoderUpdateFormatLocked( decoder_t *p_dec )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
-    vlc_assert_locked( &p_owner->lock );
+    vlc_mutex_assert( &p_owner->lock );
 
     es_format_Clean( &p_owner->fmt );
     es_format_Copy( &p_owner->fmt, &p_dec->fmt_out );
@@ -729,7 +729,7 @@ static void DecoderWaitUnblock( decoder_t *p_dec )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
 
-    vlc_assert_locked( &p_owner->lock );
+    vlc_mutex_assert( &p_owner->lock );
 
     for( ;; )
     {
@@ -777,7 +777,7 @@ static void DecoderFixTs( decoder_t *p_dec, vlc_tick_t *pi_ts0, vlc_tick_t *pi_t
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
     input_clock_t   *p_clock = p_owner->p_clock;
 
-    vlc_assert_locked( &p_owner->lock );
+    vlc_mutex_assert( &p_owner->lock );
 
     const vlc_tick_t i_es_delay = p_owner->i_ts_delay;
 
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index d051243fbf..7237ca8799 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -900,7 +900,7 @@ static void TsPushCmd( ts_thread_t *p_ts, ts_cmd_t *p_cmd )
 }
 static int TsPopCmdLocked( ts_thread_t *p_ts, ts_cmd_t *p_cmd, bool b_flush )
 {
-    vlc_assert_locked( &p_ts->lock );
+    vlc_mutex_assert( &p_ts->lock );
 
     if( TsStorageIsEmpty( p_ts->p_storage_r ) )
         return VLC_EGENERIC;
diff --git a/src/input/item.c b/src/input/item.c
index ff2532ebfa..1b3f54340d 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -694,7 +694,7 @@ int input_item_AddSlave(input_item_t *p_item, input_item_slave_t *p_slave)
 static info_category_t *InputItemFindCat( input_item_t *p_item,
                                           int *pi_index, const char *psz_cat )
 {
-    vlc_assert_locked( &p_item->lock );
+    vlc_mutex_assert( &p_item->lock );
     for( int i = 0; i < p_item->i_categories && psz_cat; i++ )
     {
         info_category_t *p_cat = p_item->pp_categories[i];
@@ -745,7 +745,7 @@ static int InputItemVaAddInfo( input_item_t *p_i,
                                const char *psz_name,
                                const char *psz_format, va_list args )
 {
-    vlc_assert_locked( &p_i->lock );
+    vlc_mutex_assert( &p_i->lock );
 
     info_category_t *p_cat = InputItemFindCat( p_i, NULL, psz_cat );
     if( !p_cat )
diff --git a/src/input/resource.c b/src/input/resource.c
index 6b826d817b..7fad698ffe 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -198,7 +198,7 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
                                    const vout_configuration_t *req_cfg,
                                    bool b_recycle )
 {
-    vlc_assert_locked( &p_resource->lock );
+    vlc_mutex_assert( &p_resource->lock );
 
     if( !req_cfg )
     {
diff --git a/src/libvlc.h b/src/libvlc.h
index 6e7ab1727b..d30dd95de2 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -83,8 +83,6 @@ bool vlc_mutex_marked(const vlc_mutex_t *);
  */
 #define vlc_mutex_assert(m) assert(vlc_mutex_marked(m))
 
-#define vlc_assert_locked(m) vlc_mutex_assert(m)
-
 /*
  * Logging
  */
diff --git a/src/misc/background_worker.c b/src/misc/background_worker.c
index 5b71071edd..acb93cd0df 100644
--- a/src/misc/background_worker.c
+++ b/src/misc/background_worker.c
@@ -86,7 +86,7 @@ static void task_Destroy(struct background_worker *worker, struct task *task)
 
 static struct task *QueueTake(struct background_worker *worker, int timeout_ms)
 {
-    vlc_assert_locked(&worker->lock);
+    vlc_mutex_assert(&worker->lock);
 
     vlc_tick_t deadline = vlc_tick_now() + VLC_TICK_FROM_MS(timeout_ms);
     bool timeout = false;
@@ -107,14 +107,14 @@ static struct task *QueueTake(struct background_worker *worker, int timeout_ms)
 
 static void QueuePush(struct background_worker *worker, struct task *task)
 {
-    vlc_assert_locked(&worker->lock);
+    vlc_mutex_assert(&worker->lock);
     vlc_list_append(&task->node, &worker->queue);
     vlc_cond_signal(&worker->queue_wait);
 }
 
 static void QueueRemoveAll(struct background_worker *worker, void *id)
 {
-    vlc_assert_locked(&worker->lock);
+    vlc_mutex_assert(&worker->lock);
     struct task *task;
     vlc_list_foreach(task, &worker->queue, node)
     {
@@ -268,7 +268,7 @@ static void* Thread( void* data )
 
 static bool SpawnThread(struct background_worker *worker)
 {
-    vlc_assert_locked(&worker->lock);
+    vlc_mutex_assert(&worker->lock);
 
     struct background_thread *thread = background_thread_Create(worker);
     if (!thread)
@@ -311,7 +311,7 @@ int background_worker_Push( struct background_worker* worker, void* entity,
 static void BackgroundWorkerCancelLocked(struct background_worker *worker,
                                          void *id)
 {
-    vlc_assert_locked(&worker->lock);
+    vlc_mutex_assert(&worker->lock);
 
     QueueRemoveAll(worker, id);
 
diff --git a/src/misc/fifo.c b/src/misc/fifo.c
index 312b93799c..e11aebdb87 100644
--- a/src/misc/fifo.c
+++ b/src/misc/fifo.c
@@ -90,7 +90,7 @@ size_t vlc_fifo_GetBytes(const vlc_fifo_t *fifo)
 
 void vlc_fifo_QueueUnlocked(block_fifo_t *fifo, block_t *block)
 {
-    vlc_assert_locked(&fifo->lock);
+    vlc_mutex_assert(&fifo->lock);
     assert(*(fifo->pp_last) == NULL);
 
     *(fifo->pp_last) = block;
@@ -109,7 +109,7 @@ void vlc_fifo_QueueUnlocked(block_fifo_t *fifo, block_t *block)
 
 block_t *vlc_fifo_DequeueUnlocked(block_fifo_t *fifo)
 {
-    vlc_assert_locked(&fifo->lock);
+    vlc_mutex_assert(&fifo->lock);
 
     block_t *block = fifo->p_first;
 
@@ -131,7 +131,7 @@ block_t *vlc_fifo_DequeueUnlocked(block_fifo_t *fifo)
 
 block_t *vlc_fifo_DequeueAllUnlocked(block_fifo_t *fifo)
 {
-    vlc_assert_locked(&fifo->lock);
+    vlc_mutex_assert(&fifo->lock);
 
     block_t *block = fifo->p_first;
 
diff --git a/src/modules/bank.c b/src/modules/bank.c
index f56fc94838..331fdc40ca 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -658,7 +658,7 @@ void module_EndBank (bool b_plugins)
  */
 void module_LoadPlugins(vlc_object_t *obj)
 {
-    /*vlc_assert_locked (&modules.lock); not for static mutexes :( */
+    /*vlc_mutex_assert (&modules.lock); not for static mutexes :( */
 
     if (modules.usage == 1)
     {
diff --git a/src/playlist/control.c b/src/playlist/control.c
index 60d9bae356..bed2cdf8c1 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -46,7 +46,7 @@ void playlist_Unlock( playlist_t *pl )
 
 void playlist_AssertLocked( playlist_t *pl )
 {
-    vlc_assert_locked( &pl_priv(pl)->lock );
+    vlc_mutex_assert( &pl_priv(pl)->lock );
 }
 
 static void playlist_vaControl( playlist_t *p_playlist, int i_query,
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 084abe73de..db8cc6d9ee 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -748,7 +748,7 @@ static picture_t *VoutVideoFilterStaticNewPicture(filter_t *filter)
 {
     vout_thread_t *vout = filter->owner.sys;
 
-    vlc_assert_locked(&vout->p->filter.lock);
+    vlc_mutex_assert(&vout->p->filter.lock);
     if (filter_chain_IsEmpty(vout->p->filter.chain_interactive))
         return VoutVideoFilterInteractiveNewPicture(filter);
 



More information about the vlc-commits mailing list