aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows
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/windows
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/windows')
-rw-r--r--src/platform/windows/win_impl.h10
-rw-r--r--src/platform/windows/win_thread.c38
2 files changed, 1 insertions, 47 deletions
diff --git a/src/platform/windows/win_impl.h b/src/platform/windows/win_impl.h
index 1659b099..db190d42 100644
--- a/src/platform/windows/win_impl.h
+++ b/src/platform/windows/win_impl.h
@@ -44,16 +44,6 @@ struct nni_plat_mtx {
SRWLOCK_INIT \
}
-struct nni_rwlock {
- SRWLOCK rwl;
- BOOLEAN exclusive;
-};
-
-#define NNI_RWLOCK_INITIALIZER \
- { \
- SRWLOCK_INIT \
- }
-
struct nni_plat_cv {
CONDITION_VARIABLE cv;
PSRWLOCK srl;
diff --git a/src/platform/windows/win_thread.c b/src/platform/windows/win_thread.c
index c76209c1..7d865604 100644
--- a/src/platform/windows/win_thread.c
+++ b/src/platform/windows/win_thread.c
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -79,42 +79,6 @@ nni_plat_mtx_unlock(nni_plat_mtx *mtx)
}
void
-nni_rwlock_init(nni_rwlock *rwl)
-{
- InitializeSRWLock(&rwl->rwl);
-}
-
-void
-nni_rwlock_fini(nni_rwlock *rwl)
-{
- rwl->exclusive = FALSE;
-}
-
-void
-nni_rwlock_rdlock(nni_rwlock *rwl)
-{
- AcquireSRWLockShared(&rwl->rwl);
-}
-
-void
-nni_rwlock_wrlock(nni_rwlock *rwl)
-{
- AcquireSRWLockExclusive(&rwl->rwl);
- rwl->exclusive = TRUE;
-}
-
-void
-nni_rwlock_unlock(nni_rwlock *rwl)
-{
- if (rwl->exclusive) {
- rwl->exclusive = FALSE;
- ReleaseSRWLockExclusive(&rwl->rwl);
- } else {
- ReleaseSRWLockShared(&rwl->rwl);
- }
-}
-
-void
nni_plat_cv_init(nni_plat_cv *cv, nni_plat_mtx *mtx)
{
InitializeConditionVariable(&cv->cv);