OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/threading/watchdog.h" | 5 #include "base/threading/watchdog.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // Ignore race of two alarms/breaks going off at roughly the same time. | 162 // Ignore race of two alarms/breaks going off at roughly the same time. |
163 AutoLock static_lock(static_data->lock); | 163 AutoLock static_lock(static_data->lock); |
164 // This was a real debugger break. | 164 // This was a real debugger break. |
165 static_data->last_debugged_alarm_time = last_alarm_time; | 165 static_data->last_debugged_alarm_time = last_alarm_time; |
166 static_data->last_debugged_alarm_delay = last_alarm_delay; | 166 static_data->last_debugged_alarm_delay = last_alarm_delay; |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 void Watchdog::ThreadDelegate::SetThreadName() const { | 170 void Watchdog::ThreadDelegate::SetThreadName() const { |
171 std::string name = watchdog_->thread_watched_name_ + " Watchdog"; | 171 std::string name = watchdog_->thread_watched_name_ + " Watchdog"; |
172 PlatformThread::SetName(name.c_str()); | 172 PlatformThread::SetName(name); |
173 DVLOG(1) << "Watchdog active: " << name; | 173 DVLOG(1) << "Watchdog active: " << name; |
174 } | 174 } |
175 | 175 |
176 // static | 176 // static |
177 void Watchdog::ResetStaticData() { | 177 void Watchdog::ResetStaticData() { |
178 StaticData* static_data = g_static_data.Pointer(); | 178 StaticData* static_data = g_static_data.Pointer(); |
179 AutoLock lock(static_data->lock); | 179 AutoLock lock(static_data->lock); |
180 static_data->last_debugged_alarm_time = TimeTicks(); | 180 static_data->last_debugged_alarm_time = TimeTicks(); |
181 static_data->last_debugged_alarm_delay = TimeDelta(); | 181 static_data->last_debugged_alarm_delay = TimeDelta(); |
182 } | 182 } |
183 | 183 |
184 } // namespace base | 184 } // namespace base |
OLD | NEW |