mirror of
https://github.com/gflags/gflags.git
synced 2025-04-05 05:25:04 +00:00
Fixing AddSan Bug in gflags.cc
This commit is contained in:
parent
80ebb424a5
commit
0661d59ae5
1 changed files with 2 additions and 3 deletions
|
@ -726,7 +726,6 @@ class FlagRegistry {
|
|||
static FlagRegistry* global_registry_; // a singleton registry
|
||||
|
||||
Mutex lock_;
|
||||
static Mutex global_registry_lock_;
|
||||
|
||||
static void InitGlobalRegistry();
|
||||
|
||||
|
@ -929,10 +928,10 @@ bool FlagRegistry::SetFlagLocked(CommandLineFlag* flag,
|
|||
|
||||
// Get the singleton FlagRegistry object
|
||||
FlagRegistry* FlagRegistry::global_registry_ = NULL;
|
||||
Mutex FlagRegistry::global_registry_lock_(Mutex::LINKER_INITIALIZED);
|
||||
|
||||
FlagRegistry* FlagRegistry::GlobalRegistry() {
|
||||
MutexLock acquire_lock(&global_registry_lock_);
|
||||
static Mutex lock(Mutex::LINKER_INITIALIZED);
|
||||
MutexLock acquire_lock(&lock);
|
||||
if (!global_registry_) {
|
||||
global_registry_ = new FlagRegistry;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue