Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
95ffb27c
Commit
95ffb27c
authored
May 12, 2017
by
Mmanu Chaturvedi
Committed by
Andreas Schuh
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static initialization order fiasco caused by global registry lock (#215)
parent
80ebb424
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
gflags.cc
src/gflags.cc
+2
-3
No files found.
src/gflags.cc
View file @
95ffb27c
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment