From d025defb9870cf3ed85ab90ab346a12b1eebe082 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Tue, 9 Nov 2021 21:12:21 +0800 Subject: [PATCH] Bug 1606864 - Make mDoNotRetryToConnect atomic. r=decoder,dragana a=RyanVM Bug 1712671 - Make nsSocketTransport2::m{Input/Output}StreamClosed atomic. r=kershaw,decoder a=RyanVM --- netwerk/base/nsSocketTransport2.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/netwerk/base/nsSocketTransport2.h b/netwerk/base/nsSocketTransport2.h index 310cc58d3b..cb107e6e79 100644 --- a/netwerk/base/nsSocketTransport2.h +++ b/netwerk/base/nsSocketTransport2.h @@ -306,6 +306,9 @@ private: uint16_t SocketPort() { return (!mProxyHost.IsEmpty() && !mProxyTransparent) ? mProxyPort : mPort; } const nsCString &SocketHost() { return (!mProxyHost.IsEmpty() && !mProxyTransparent) ? mProxyHost : mHost; } + Atomic mInputClosed{true}; + Atomic mOutputClosed{true}; + //------------------------------------------------------------------------- // members accessible only on the socket transport thread: // (the exception being initialization/shutdown time) @@ -314,8 +317,6 @@ private: // socket state vars: uint32_t mState; // STATE_??? flags bool mAttached; - bool mInputClosed; - bool mOutputClosed; // The platform-specific network interface id that this socket // associated with. @@ -455,7 +456,7 @@ private: int32_t mKeepaliveRetryIntervalS; int32_t mKeepaliveProbeCount; - bool mDoNotRetryToConnect; + Atomic mDoNotRetryToConnect{false}; }; } // namespace net