From 60cee967dc56723ec67f04047a0d239e61721669 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 21 Sep 2023 15:50:43 +0100 Subject: [PATCH] Add a pthread_cleanup compatible function to release a pthread_rwlock. --- common.c | 2 ++ common.h | 1 + 2 files changed, 3 insertions(+) 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);