C++ fix: fix profiler when start and stop are executed by different threads