diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:16:26 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:16:26 +0000 |
commit | 5be7da24155466bf0e9bf2e5fda1a581e549df8d (patch) | |
tree | e14153b1254d3eacaaa65a9997d7edf9775d4036 /chrome/browser/sync | |
parent | 8a92555e667090d8c6592ebe670628ca33b86ef0 (diff) | |
download | chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.zip chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.tar.gz chromium_src-5be7da24155466bf0e9bf2e5fda1a581e549df8d.tar.bz2 |
Use AutoReset (formerly ScopedBool) where possible.
This frequently saves a tiny bit of code, but even when it doesn't I think it's more future-proof (less error-prone).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/399096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/engine/syncer_thread_timed_stop.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/sync/engine/syncer_thread_timed_stop.cc b/chrome/browser/sync/engine/syncer_thread_timed_stop.cc index 4bc9916..12f553b 100644 --- a/chrome/browser/sync/engine/syncer_thread_timed_stop.cc +++ b/chrome/browser/sync/engine/syncer_thread_timed_stop.cc @@ -15,6 +15,7 @@ #include <map> #include <queue> +#include "base/auto_reset.h" #include "chrome/browser/sync/engine/auth_watcher.h" #include "chrome/browser/sync/engine/model_safe_worker.h" #include "chrome/browser/sync/engine/net/server_connection_manager.h" @@ -108,10 +109,11 @@ void SyncerThreadTimedStop::ThreadMain() { // The only thing that could be waiting on this value is Stop, and we don't // release the lock until we're far enough along to Stop safely. - in_thread_main_loop_ = true; - vault_field_changed_.Broadcast(); - ThreadMainLoop(); - in_thread_main_loop_ = false; + { + AutoReset auto_reset_in_thread_main_loop(&in_thread_main_loop_, true); + vault_field_changed_.Broadcast(); + ThreadMainLoop(); + } vault_field_changed_.Broadcast(); LOG(INFO) << "Syncer thread ThreadMain is done."; } |