Bug 1606864 - Make mDoNotRetryToConnect atomic r=necko-reviewers,decoder,dragana

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 db56571b13
commit 01dbf4259f
2 changed files with 1 additions and 5 deletions

View file

@ -231,10 +231,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.