Skip to content

Commit

Permalink
pthread destroy: revert. No way to please static analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelienpierre committed Nov 19, 2023
1 parent e44dbed commit 3b08349
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/common/dtpthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
};

Expand Down

0 comments on commit 3b08349

Please sign in to comment.