Lines Matching defs:ThreadGlobalData
48 class ThreadGlobalData : public Noncopyable {
50 ThreadGlobalData();
51 ~ThreadGlobalData();
85 static ThreadSpecific<ThreadGlobalData>* staticData;
87 static ThreadGlobalData* staticData;
89 friend ThreadGlobalData& threadGlobalData();
92 inline ThreadGlobalData& threadGlobalData()
98 // ThreadGlobalData is used on main thread before it could possibly be used on secondary ones, so there is no need for synchronization here.
99 if (!ThreadGlobalData::staticData)
100 ThreadGlobalData::staticData = new ThreadSpecific<ThreadGlobalData>;
101 return **ThreadGlobalData::staticData;
103 if (!ThreadGlobalData::staticData) {
104 ThreadGlobalData::staticData = static_cast<ThreadGlobalData*>(fastMalloc(sizeof(ThreadGlobalData)));
105 // ThreadGlobalData constructor indirectly uses staticData, so we need to set up the memory before invoking it.
106 new (ThreadGlobalData::staticData) ThreadGlobalData;
108 return *ThreadGlobalData::staticData;