From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:50:43 +0000 (+0100) Subject: Add a pthread_cleanup compatible function to release a pthread_rwlock. X-Git-Tag: 4.3.2^2~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60cee967dc56723ec67f04047a0d239e61721669;p=thirdparty%2Fshairport-sync.git Add a pthread_cleanup compatible function to release a pthread_rwlock. --- diff --git a/common.c b/common.c index d16e3b1f..4dc75bc7 100644 --- a/common.c +++ b/common.c @@ -1725,6 +1725,8 @@ void mutex_cleanup(void *arg) { void mutex_unlock(void *arg) { pthread_mutex_unlock((pthread_mutex_t *)arg); } +void rwlock_unlock(void *arg) { pthread_rwlock_unlock((pthread_rwlock_t *)arg); } + void thread_cleanup(void *arg) { debug(3, "thread_cleanup called."); pthread_t *thread = (pthread_t *)arg; diff --git a/common.h b/common.h index edd48fa8..1b9e2f03 100644 --- a/common.h +++ b/common.h @@ -495,6 +495,7 @@ uint16_t bind_UDP_port(int ip_family, const char *self_ip_address, uint32_t scop void socket_cleanup(void *arg); void mutex_unlock(void *arg); +void rwlock_unlock(void *arg); void mutex_cleanup(void *arg); void cv_cleanup(void *arg); void thread_cleanup(void *arg);