OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef REMOTING_HOST_SHUTDOWN_WATCHDOG_H_ | 5 #ifndef REMOTING_HOST_SHUTDOWN_WATCHDOG_H_ |
6 #define REMOTING_HOST_SHUTDOWN_WATCHDOG_H_ | 6 #define REMOTING_HOST_SHUTDOWN_WATCHDOG_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
9 #include "base/threading/watchdog.h" | 10 #include "base/threading/watchdog.h" |
10 | 11 |
11 namespace remoting { | 12 namespace remoting { |
12 | 13 |
13 // This implements a watchdog timer that ensures the host process eventually | 14 // This implements a watchdog timer that ensures the host process eventually |
14 // terminates, even if some threads are blocked or being kept alive for | 15 // terminates, even if some threads are blocked or being kept alive for |
15 // some reason. This is not expected to trigger if host shutdown is working | 16 // some reason. This is not expected to trigger if host shutdown is working |
16 // correctly (on a normally loaded system). The triggering of the alarm | 17 // correctly (on a normally loaded system). The triggering of the alarm |
17 // indicates a sign of trouble, and so the Alarm() method will log some | 18 // indicates a sign of trouble, and so the Alarm() method will log some |
(...skipping 15 matching lines...) Expand all Loading... |
33 | 34 |
34 // Protects |exit_code_|, since Alarm() gets called on a separate thread. | 35 // Protects |exit_code_|, since Alarm() gets called on a separate thread. |
35 base::Lock lock_; | 36 base::Lock lock_; |
36 | 37 |
37 DISALLOW_COPY_AND_ASSIGN(ShutdownWatchdog); | 38 DISALLOW_COPY_AND_ASSIGN(ShutdownWatchdog); |
38 }; | 39 }; |
39 | 40 |
40 } // namespace remoting | 41 } // namespace remoting |
41 | 42 |
42 #endif // REMOTING_HOST_SHUTDOWN_WATCHDOG_H_ | 43 #endif // REMOTING_HOST_SHUTDOWN_WATCHDOG_H_ |
OLD | NEW |