All sleep calls via std::this_thread
[invirt/third/libt4.git] / t4.h
1 #ifndef t4_h
2 #define t4_h
3
4 #include "types.h"
5 #include "rpc/poll_mgr.h"
6
7 struct t4_state {
8     std::mutex log_mutex;
9     std::map<thread::id, int> thread_name_map;
10     std::map<const void *, int> instance_name_map;
11
12     poll_mgr shared_mgr;
13
14     int next_thread_num = 0;
15     int next_instance_num = 0;
16     int DEBUG_LEVEL = 0;
17     char log_thread_prefix;
18
19     std::mutex handle_cache_mutex;
20     std::map<string, shared_ptr<class rpcc>> handle_cache;
21
22     shared_ptr<class rpcc> get_handle(const string & destination);
23     void erase_handle(const string & destination);
24
25     std::mt19937_64 random_generator;
26
27     t4_state(char log_prefix = ' ');
28     ~t4_state();
29 };
30
31 extern t4_state *global;
32
33 #endif