diff options
author | Craig Silverstein <csilvers+gflags@google.com> | 2011-12-01 01:58:29 +0000 |
---|---|---|
committer | Craig Silverstein <csilvers+gflags@google.com> | 2011-12-01 01:58:29 +0000 |
commit | 80912052d04cf3af319c7159a6bd3bf820f26c54 (patch) | |
tree | 2b20ddab6bbca26ccb244b47711e2d6950342c2e /src | |
parent | be2da58d73fb65b134a44d46e08c1aec26cf579a (diff) | |
download | gflags-80912052d04cf3af319c7159a6bd3bf820f26c54.tar.gz gflags-80912052d04cf3af319c7159a6bd3bf820f26c54.tar.bz2 gflags-80912052d04cf3af319c7159a6bd3bf820f26c54.zip |
Clarify thread-safety comment for FlagSaver.
Tested:
blaze test base:commandlineflags_unittest
R=csilvers
DELTA=4 (3 added, 0 deleted, 1 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=3791
git-svn-id: https://gflags.googlecode.com/svn/trunk@71 6586e3c6-dcc4-952a-343f-ff74eb82781d
Diffstat (limited to 'src')
-rw-r--r-- | src/gflags/gflags.h.in | 5 | ||||
-rw-r--r-- | src/windows/gflags/gflags.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gflags/gflags.h.in b/src/gflags/gflags.h.in index 4b11bad..c58beee 100644 --- a/src/gflags/gflags.h.in +++ b/src/gflags/gflags.h.in @@ -267,7 +267,10 @@ extern std::string SetCommandLineOptionWithMode(const char* name, const char* va // usage example above, the compiler would complain that it's an // unused variable. // -// This class is thread-safe. +// This class is thread-safe. However, its destructor writes to +// exactly the set of flags that have changed value during its +// lifetime, so concurrent _direct_ access to those flags +// (i.e. FLAGS_foo instead of {Get,Set}CommandLineOption()) is unsafe. class GFLAGS_DLL_DECL FlagSaver { public: diff --git a/src/windows/gflags/gflags.h b/src/windows/gflags/gflags.h index 0c3a22e..8b70a37 100644 --- a/src/windows/gflags/gflags.h +++ b/src/windows/gflags/gflags.h @@ -271,7 +271,10 @@ extern GFLAGS_DLL_DECL std::string SetCommandLineOptionWithMode(const char* name // usage example above, the compiler would complain that it's an // unused variable. // -// This class is thread-safe. +// This class is thread-safe. However, its destructor writes to +// exactly the set of flags that have changed value during its +// lifetime, so concurrent _direct_ access to those flags +// (i.e. FLAGS_foo instead of {Get,Set}CommandLineOption()) is unsafe. class GFLAGS_DLL_DECL FlagSaver { public: |