зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1204042 - make nsSocketTransportService::mTelemetryEnabledPref an atomic variable; r=mcmanus
This variable is written on the main thread (where we can access prefs), but read on the socket thread on every poll iteration to decide whether we should record telemetry information. Making it atomic communicates our intent to read/write the value on multiple threads without any locking. Using relaxed memory consistency is just as efficient as what we have today, and it does not seem terribly crucial whether the *very next* poll iteration records telemetry once the pref is updated, or whether we can eventually get the correct value on the socket thread.
This commit is contained in:
Родитель
ac24c08b7f
Коммит
fd7eb3b17b
|
@ -239,7 +239,7 @@ private:
|
|||
bool mServeMultipleEventsPerPollIter;
|
||||
mozilla::Atomic<bool> mServingPendingQueue;
|
||||
int32_t mMaxTimePerPollIter;
|
||||
bool mTelemetryEnabledPref;
|
||||
mozilla::Atomic<bool, mozilla::Relaxed> mTelemetryEnabledPref;
|
||||
|
||||
void OnKeepaliveEnabledPrefChange();
|
||||
void NotifyKeepaliveEnabledPrefChange(SocketContext *sock);
|
||||
|
|
Загрузка…
Ссылка в новой задаче