TCPSPSuite
thread_checker.hpp
1 #ifndef THREAD_CHECKER_HPP
2 #define THREAD_CHECKER_HPP
3 
4 #include "log.hpp"
5 #include "../manager/timer.hpp"
6 #include <mutex> // for mutex
7 
8 namespace util {
9 
10 class ThreadChecker {
11 public:
12  static ThreadChecker & get();
13  void check(int thread_id);
14 private:
15  Timer t;
16  std::mutex m;
17  std::map<int, double> last_checked;
18  ThreadChecker();
19 
20  Log l;
21 };
22 
23 }
24 
25 #endif