treelite
thread_local.h
Go to the documentation of this file.
1 
7 #ifndef TREELITE_THREAD_LOCAL_H_
8 #define TREELITE_THREAD_LOCAL_H_
9 
10 namespace treelite {
11 
16 template <typename T>
18  public:
20  static T* Get() {
21  static thread_local T inst;
22  return &inst;
23  }
24 };
25 
26 } // namespace treelite
27 
28 #endif // TREELITE_THREAD_LOCAL_H_
A thread-local storage.
Definition: thread_local.h:17
static T * Get()
Definition: thread_local.h:20
Definition: contiguous_array.h:14