Bug 1407810 - Make DecoderDoctorLogger::sLogState 'ReleaseAcquire' - r=jwwang

sLogState is accessed at least once for every DDLog call, even when logging is
disabled, so we want it to be as quick as possible for minimal impact on most
users.

MozReview-Commit-ID: AMstgXmixrv

--HG--
extra : rebase_source : 475b32f76d9660d03333047eb7e7add62b717a79
This commit is contained in:
Gerald Squelart 2017-10-12 10:45:03 +11:00
Родитель 6379d18e57
Коммит 3704f8907e
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -14,7 +14,7 @@
namespace mozilla {
/* static */ Atomic<DecoderDoctorLogger::LogState>
/* static */ Atomic<DecoderDoctorLogger::LogState, ReleaseAcquire>
DecoderDoctorLogger::sLogState{ DecoderDoctorLogger::scDisabled };
/* static */ const char* DecoderDoctorLogger::sShutdownReason = nullptr;

Просмотреть файл

@ -346,7 +346,9 @@ private:
// Shutdown, cannot be re-enabled.
static constexpr LogState scShutdown = 3;
// Current state.
static Atomic<LogState> sLogState;
// "ReleaseAcquire" because when changing to scEnabled, the just-created
// sMediaLogs must be accessible to consumers that see scEnabled.
static Atomic<LogState, ReleaseAcquire> sLogState;
// If non-null, reason for an abnormal shutdown.
static const char* sShutdownReason;