mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1712671 - Make nsSocketTransport2::m{Input/Output}StreamClosed atomic. r=kershaw,decoder a=RyanVM
Fixes race between nsSocketTransport::OnInputClosed and nsSocketTransport::OpenInputStream. Same for output streams. Differential Revision: https://phabricator.services.mozilla.com/D128183
This commit is contained in:
parent
22470a9d77
commit
c7a2989bc7
@ -221,8 +221,6 @@ extern "C" const char* __tsan_default_suppressions() {
|
||||
// Bug 1606864
|
||||
"race:nsSocketTransport::Close\n"
|
||||
"race:nsSocketTransport::OnSocketDetached\n"
|
||||
"race:nsSocketTransport::OnMsgInputClosed\n"
|
||||
"race:nsSocketTransport::OpenOutputStream\n"
|
||||
|
||||
// Bug 1615017
|
||||
"race:CacheFileMetadata::SetHash\n"
|
||||
|
@ -303,6 +303,9 @@ class nsSocketTransport final : public nsASocketHandler,
|
||||
return (!mProxyHost.IsEmpty() && !mProxyTransparent) ? mProxyHost : mHost;
|
||||
}
|
||||
|
||||
Atomic<bool> mInputClosed{true};
|
||||
Atomic<bool> mOutputClosed{true};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// members accessible only on the socket transport thread:
|
||||
// (the exception being initialization/shutdown time)
|
||||
@ -311,8 +314,6 @@ class nsSocketTransport final : public nsASocketHandler,
|
||||
// socket state vars:
|
||||
uint32_t mState{STATE_CLOSED}; // STATE_??? flags
|
||||
bool mAttached{false};
|
||||
bool mInputClosed{true};
|
||||
bool mOutputClosed{true};
|
||||
|
||||
// this flag is used to determine if the results of a host lookup arrive
|
||||
// recursively or not. this flag is not protected by any lock.
|
||||
|
Loading…
Reference in New Issue
Block a user