Bug 1606864 - Make mDoNotRetryToConnect atomic. r=decoder,dragana a=RyanVM

Fixes race between nsSocketTransport::Close and
nsSocketTransport::RecoverFromError called from OnSocketDetached.

Depends on D128183

Differential Revision: https://phabricator.services.mozilla.com/D128364
This commit is contained in:
Valentin Gosu 2021-10-18 13:53:16 +00:00
parent c7a2989bc7
commit ab7f439036
2 changed files with 1 additions and 5 deletions

View File

@ -218,10 +218,6 @@ extern "C" const char* __tsan_default_suppressions() {
// Bug 1606803
"race:ipv6_is_present\n"
// Bug 1606864
"race:nsSocketTransport::Close\n"
"race:nsSocketTransport::OnSocketDetached\n"
// Bug 1615017
"race:CacheFileMetadata::SetHash\n"
"race:CacheFileMetadata::OnDataWritten\n"

View File

@ -457,7 +457,7 @@ class nsSocketTransport final : public nsASocketHandler,
int32_t mKeepaliveRetryIntervalS{-1};
int32_t mKeepaliveProbeCount{-1};
bool mDoNotRetryToConnect{false};
Atomic<bool> mDoNotRetryToConnect{false};
// Whether the port remapping has already been applied. We definitely want to
// prevent duplicate calls in case of chaining remapping.