From dee448ac8b7dd0f80a48bc0b2e59aec68c651b88 Mon Sep 17 00:00:00 2001 From: toluRV <111301355+toluRV@users.noreply.github.com> Date: Wed, 5 Oct 2022 04:55:40 -0400 Subject: [PATCH] Fixed compile errors on windows (#2278) Compile error seems to be caused by https://github.com/apple/swift-nio/pull/2266/ --- Sources/NIOConcurrencyHelpers/NIOLock.swift | 2 +- Sources/NIOConcurrencyHelpers/lock.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/NIOConcurrencyHelpers/NIOLock.swift b/Sources/NIOConcurrencyHelpers/NIOLock.swift index 3c70d604a..1eedda432 100644 --- a/Sources/NIOConcurrencyHelpers/NIOLock.swift +++ b/Sources/NIOConcurrencyHelpers/NIOLock.swift @@ -75,7 +75,7 @@ public struct NIOLock { internal func unlock() { #if os(Windows) - ReleaseSRWLockExclusive(self._storage.mutex) + ReleaseSRWLockExclusive(self.mutex) #else let err = pthread_mutex_unlock(self.mutex) precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") diff --git a/Sources/NIOConcurrencyHelpers/lock.swift b/Sources/NIOConcurrencyHelpers/lock.swift index 124d400d7..5c3d32dc3 100644 --- a/Sources/NIOConcurrencyHelpers/lock.swift +++ b/Sources/NIOConcurrencyHelpers/lock.swift @@ -221,7 +221,7 @@ public final class ConditionLock { } let dwWaitStart = timeGetTime() - if !SleepConditionVariableSRW(self.cond, self.mutex.mutex, + if !SleepConditionVariableSRW(self.cond, self.mutex._storage.mutex, dwMilliseconds, 0) { let dwError = GetLastError() if (dwError == ERROR_TIMEOUT) {