This patch fixes https://github.com/llvm/llvm-project/issues/54768. A ProgressEventReporter creates a dedicated thread that keeps checking whether there are new events that need to be sent to IDE as long as m_thread_should_exit is true. When the VSCode instance is destructed, it will set m_thread_should_exit to false, which caused a data race because at the same time its ProgressEventReporter is reading this value to determine whether it should quit. This fix simply uses mutex to ensure they cannot read and write this value at the same time.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Another solution would be to make m_thread_should_exit a std::atomic<bool> type instead of just a bool.
Comment Actions
Hi, I just forgot to mention that I don't really have access to commit... So if any people see this and this patch looks good to them, maybe please help me commit this one?