@@ -1153,23 +1153,39 @@ static inline void sw_set_period_event(snd_pcm_sw_params_t *params, int val)
*/
static inline void __snd_pcm_lock(snd_pcm_t *pcm)
{
- if (pcm->lock_enabled)
- pthread_mutex_lock(&pcm->lock);
+ int lock_err;
+
+ if (pcm->lock_enabled) {
+ lock_err = pthread_mutex_lock(&pcm->lock);
+ assert(lock_err == 0);
+ }
}
static inline void __snd_pcm_unlock(snd_pcm_t *pcm)
{
- if (pcm->lock_enabled)
- pthread_mutex_unlock(&pcm->lock);
+ int unlock_err;
+
+ if (pcm->lock_enabled) {
+ unlock_err = pthread_mutex_unlock(&pcm->lock);
+ assert(unlock_err == 0);
+ }
}
static inline void snd_pcm_lock(snd_pcm_t *pcm)
{
- if (pcm->lock_enabled && pcm->need_lock)
- pthread_mutex_lock(&pcm->lock);
+ int lock_err;
+
+ if (pcm->lock_enabled && pcm->need_lock) {
+ lock_err = pthread_mutex_lock(&pcm->lock);
+ assert(lock_err == 0);
+ }
}
static inline void snd_pcm_unlock(snd_pcm_t *pcm)
{
- if (pcm->lock_enabled && pcm->need_lock)
- pthread_mutex_unlock(&pcm->lock);
+ int unlock_err;
+
+ if (pcm->lock_enabled && pcm->need_lock) {
+ unlock_err = pthread_mutex_unlock(&pcm->lock);
+ assert(unlock_err == 0);
+ }
}
/*
This makes it easier to find pcm mutex handling errors. Signed-off-by: Ben Russell <thematrixeatsyou@gmail.com> --- src/pcm/pcm_local.h | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-)