| 39 | public: |
| 40 | |
| 41 | Profiler(const String &inDumpFile) |
| 42 | : mT0(0) |
| 43 | { |
| 44 | mDumpFile = inDumpFile; |
| 45 | |
| 46 | // When a profiler exists, the profiler thread needs to exist |
| 47 | |
| 48 | std::lock_guard<std::mutex> lock(gThreadMutex); |
| 49 | |
| 50 | gThreadRefCount += 1; |
| 51 | |
| 52 | if (gThreadRefCount == 1) { |
| 53 | std::thread thread(ProfileMainLoop); |
| 54 | thread.detach(); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | ~Profiler() |
| 59 | { |