diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-05 09:46:16 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-05 09:49:56 -0800 |
| commit | e5d5b625f16c3c3df5a3fdcc114a6694d82ab6e8 (patch) | |
| tree | 8cf3f1ede137ac8c08c002700a297fe0d6972fd3 /src/core | |
| parent | cf7dda752e1a49cb1003b0e300a5200ff0b0c92e (diff) | |
| download | nng-e5d5b625f16c3c3df5a3fdcc114a6694d82ab6e8.tar.gz nng-e5d5b625f16c3c3df5a3fdcc114a6694d82ab6e8.tar.bz2 nng-e5d5b625f16c3c3df5a3fdcc114a6694d82ab6e8.zip | |
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.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/platform.h | 17 |
1 files changed, 3 insertions, 14 deletions
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 |
