Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3048)

Unified Diff: base/threading/watchdog.h

Issue 9173002: Watchdog - Added a JOINABLE state to avoid StartupTimebomb (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/threading/watchdog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/watchdog.h
===================================================================
--- base/threading/watchdog.h (revision 117912)
+++ base/threading/watchdog.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -38,6 +38,13 @@
bool enabled);
virtual ~Watchdog();
+ // Notify watchdog thread to finish up. Sets the state_ to SHUTDOWN.
+ void Cleanup();
+
+ // Returns true if we state_ is JOINABLE (which indicates that Watchdog has
+ // exited).
+ bool IsJoinable();
+
// Start timing, and alarm when time expires (unless we're disarm()ed.)
void Arm(); // Arm starting now.
void ArmSomeTimeDeltaAgo(const TimeDelta& time_delta);
@@ -66,9 +73,9 @@
Watchdog* watchdog_;
};
- enum State {ARMED, DISARMED, SHUTDOWN };
+ enum State {ARMED, DISARMED, SHUTDOWN, JOINABLE };
- bool init_successful_;
+ bool enabled_;
Lock lock_; // Mutex for state_.
ConditionVariable condition_variable_;
« no previous file with comments | « no previous file | base/threading/watchdog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698