diff --git a/src/common/dtpthread.h b/src/common/dtpthread.h index d028455287d8..f8666f5b7434 100644 --- a/src/common/dtpthread.h +++ b/src/common/dtpthread.h @@ -64,8 +64,6 @@ typedef struct dt_pthread_rwlock_t static inline int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex) { - // Prevent mutexes from being destroyed if they are still locked by a thread. - pthread_mutex_unlock(&mutex->mutex); const int ret = pthread_mutex_destroy(&(mutex->mutex)); assert(!ret); @@ -323,8 +321,6 @@ static inline int dt_pthread_mutex_unlock(dt_pthread_mutex_t *mutex) RELEASE(mut static inline int dt_pthread_mutex_destroy(dt_pthread_mutex_t *mutex) { - // Prevent mutexes from being destroyed if they are still locked by a thread. - pthread_mutex_unlock(&mutex->mutex); return pthread_mutex_destroy(&mutex->mutex); };