bug 1132212 - nshttptransction.cpp dont play with data race fire r=sworkman

--HG--
extra : rebase_source : 9c36261b9ce11598664932f2e40693eee735b498
This commit is contained in:
Patrick McManus 2015-02-12 15:00:18 -05:00
parent ea6de563d8
commit f6e7bab9dc
3 changed files with 14 additions and 9 deletions

View File

@ -59,10 +59,12 @@ protected:
private:
// mCapsToClear holds flags that should be cleared in mCaps, e.g. unset
// NS_HTTP_REFRESH_DNS when DNS refresh request has completed to avoid
// redundant requests on the network. To deal with raciness, only unsetting
// redundant requests on the network. The member itself is atomic, but
// access to it from the networking thread may happen either before or
// after the main thread modifies it. To deal with raciness, only unsetting
// bitfields should be allowed: 'lost races' will thus err on the
// conservative side, e.g. by going ahead with a 2nd DNS refresh.
uint32_t mCapsToClear;
Atomic<uint32_t> mCapsToClear;
nsHttpRequestHead *mRequestHead;
bool mIsDone;
bool mClaimed;

View File

@ -102,9 +102,9 @@ nsHttpTransaction::nsHttpTransaction()
, mPriority(0)
, mRestartCount(0)
, mCaps(0)
, mCapsToClear(0)
, mClassification(CLASS_GENERAL)
, mPipelinePosition(0)
, mCapsToClear(0)
, mHttpVersion(NS_HTTP_VERSION_UNKNOWN)
, mClosed(false)
, mConnected(false)

View File

@ -248,16 +248,19 @@ private:
uint16_t mRestartCount; // the number of times this transaction has been restarted
uint32_t mCaps;
// mCapsToClear holds flags that should be cleared in mCaps, e.g. unset
// NS_HTTP_REFRESH_DNS when DNS refresh request has completed to avoid
// redundant requests on the network. To deal with raciness, only unsetting
// bitfields should be allowed: 'lost races' will thus err on the
// conservative side, e.g. by going ahead with a 2nd DNS refresh.
uint32_t mCapsToClear;
enum Classifier mClassification;
int32_t mPipelinePosition;
int64_t mMaxPipelineObjectSize;
// mCapsToClear holds flags that should be cleared in mCaps, e.g. unset
// NS_HTTP_REFRESH_DNS when DNS refresh request has completed to avoid
// redundant requests on the network. The member itself is atomic, but
// access to it from the networking thread may happen either before or
// after the main thread modifies it. To deal with raciness, only unsetting
// bitfields should be allowed: 'lost races' will thus err on the
// conservative side, e.g. by going ahead with a 2nd DNS refresh.
Atomic<uint32_t> mCapsToClear;
nsHttpVersion mHttpVersion;
// state flags, all logically boolean, but not packed together into a