From e5d5b625f16c3c3df5a3fdcc114a6694d82ab6e8 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 5 Jan 2025 09:46:16 -0800 Subject: platform: remove reader/writer locks The only thing using this was the transport lookups, but as those transports are now fully initialized in nng_init, we no longer need to lock that at all. --- src/core/platform.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/core') diff --git a/src/core/platform.h b/src/core/platform.h index 4ca6a2f4..ca39ac98 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -85,11 +85,9 @@ extern void *nni_zalloc(size_t); // Most implementations can just call free() here. extern void nni_free(void *, size_t); -typedef struct nni_plat_mtx nni_plat_mtx; -typedef struct nni_plat_rwlock nni_plat_rwlock; -typedef struct nni_plat_cv nni_plat_cv; -typedef struct nni_plat_thr nni_plat_thr; -typedef struct nni_rwlock nni_rwlock; +typedef struct nni_plat_mtx nni_plat_mtx; +typedef struct nni_plat_cv nni_plat_cv; +typedef struct nni_plat_thr nni_plat_thr; // // Threading & Synchronization Support @@ -111,15 +109,6 @@ extern void nni_plat_mtx_lock(nni_plat_mtx *); // thread that owned the mutex. extern void nni_plat_mtx_unlock(nni_plat_mtx *); -// read/write locks - these work like mutexes except that multiple readers -// can acquire the lock. These are not safe for recursive use, and it is -// unspecified whether any measures are provided to prevent starvation. -extern void nni_rwlock_init(nni_rwlock *); -extern void nni_rwlock_fini(nni_rwlock *); -extern void nni_rwlock_rdlock(nni_rwlock *); -extern void nni_rwlock_wrlock(nni_rwlock *); -extern void nni_rwlock_unlock(nni_rwlock *); - // nni_plat_cv_init initializes a condition variable. We require a mutex be // supplied with it, and that mutex must always be held when performing any // operations on the condition variable (other than fini.) As with mutexes, an -- cgit v1.2.3-70-g09d2