Remove excessive copyright/license boilerplate
[platform/upstream/nodejs.git] / src / node_watchdog.h
1 #ifndef SRC_NODE_WATCHDOG_H_
2 #define SRC_NODE_WATCHDOG_H_
3
4 #include "v8.h"
5 #include "uv.h"
6
7 #include "env.h"
8
9 namespace node {
10
11 class Watchdog {
12  public:
13   explicit Watchdog(Environment* env, uint64_t ms);
14   ~Watchdog();
15
16   void Dispose();
17
18   inline Environment* env() const { return env_; }
19
20  private:
21   void Destroy();
22
23   static void Run(void* arg);
24   static void Async(uv_async_t* async);
25   static void Timer(uv_timer_t* timer);
26
27   Environment* env_;
28   uv_thread_t thread_;
29   uv_loop_t* loop_;
30   uv_async_t async_;
31   uv_timer_t timer_;
32   bool destroyed_;
33 };
34
35 }  // namespace node
36
37 #endif  // SRC_NODE_WATCHDOG_H_