aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_thread.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-05 09:46:16 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-05 09:49:56 -0800
commite5d5b625f16c3c3df5a3fdcc114a6694d82ab6e8 (patch)
tree8cf3f1ede137ac8c08c002700a297fe0d6972fd3 /src/platform/posix/posix_thread.c
parentcf7dda752e1a49cb1003b0e300a5200ff0b0c92e (diff)
downloadnng-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/platform/posix/posix_thread.c')
-rw-r--r--src/platform/posix/posix_thread.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/platform/posix/posix_thread.c b/src/platform/posix/posix_thread.c
index e8c9036c..ac6371c9 100644
--- a/src/platform/posix/posix_thread.c
+++ b/src/platform/posix/posix_thread.c
@@ -156,53 +156,6 @@ nni_plat_mtx_unlock(nni_plat_mtx *mtx)
}
void
-nni_rwlock_init(nni_rwlock *rwl)
-{
- while (pthread_rwlock_init(&rwl->rwl, NULL) != 0) {
- // We must have memory exhaustion -- ENOMEM, or
- // in some cases EAGAIN. Wait a bit before we try to
- // give things a chance to settle down.
- nni_msleep(10);
- }
-}
-
-void
-nni_rwlock_fini(nni_rwlock *rwl)
-{
- int rv;
- if ((rv = pthread_rwlock_destroy(&rwl->rwl)) != 0) {
- nni_panic("pthread_rwlock_destroy: %s", strerror(rv));
- }
-}
-
-void
-nni_rwlock_rdlock(nni_rwlock *rwl)
-{
- int rv;
- if ((rv = pthread_rwlock_rdlock(&rwl->rwl)) != 0) {
- nni_panic("pthread_rwlock_rdlock: %s", strerror(rv));
- }
-}
-
-void
-nni_rwlock_wrlock(nni_rwlock *rwl)
-{
- int rv;
- if ((rv = pthread_rwlock_wrlock(&rwl->rwl)) != 0) {
- nni_panic("pthread_rwlock_wrlock: %s", strerror(rv));
- }
-}
-
-void
-nni_rwlock_unlock(nni_rwlock *rwl)
-{
- int rv;
- if ((rv = pthread_rwlock_unlock(&rwl->rwl)) != 0) {
- nni_panic("pthread_rwlock_unlock: %s", strerror(rv));
- }
-}
-
-void
nni_plat_cv_init(nni_plat_cv *cv, nni_plat_mtx *mtx)
{
// See the comments in nni_plat_mtx_init. Almost everywhere this