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

Unified Diff: chrome/browser/metrics/thread_watcher.cc

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
« base/threading/watchdog.cc ('K') | « chrome/browser/metrics/thread_watcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/thread_watcher.cc
===================================================================
--- chrome/browser/metrics/thread_watcher.cc (revision 117912)
+++ chrome/browser/metrics/thread_watcher.cc (working copy)
@@ -855,12 +855,27 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
jar (doing other things) 2012/01/18 17:24:44 FYI: This is an assertion that is failing on the t
ramant (doing other things) 2012/01/18 20:45:30 It was being run on Test thread. The DCHECK was wr
if (startup_watchdog_) {
startup_watchdog_->Disarm();
+ startup_watchdog_->Cleanup();
+ DeleteStartupWatchdog();
+ }
+}
+
+void StartupTimeBomb::DeleteStartupWatchdog() {
+ DCHECK_EQ(thread_id_, base::PlatformThread::CurrentId());
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (startup_watchdog_->IsJoinable()) {
// Allow the watchdog thread to shutdown on UI. Watchdog thread shutdowns
// very fast.
base::ThreadRestrictions::SetIOAllowed(true);
delete startup_watchdog_;
startup_watchdog_ = NULL;
+ return;
}
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&StartupTimeBomb::DeleteStartupWatchdog,
+ base::Unretained(this)),
+ base::TimeDelta::FromSeconds(10).InMilliseconds());
}
// static
« base/threading/watchdog.cc ('K') | « chrome/browser/metrics/thread_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698