mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
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:
parent
ac24c08b7f
commit
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);
|
||||
|
Loading…
Reference in New Issue
Block a user