bbeaafac8b
The crash occurs because the thread terminates the task prematurely due to PostMessage’s nature. As a result, FileManager::backupCurrentBuffer() is always executed by the main thread, leading to a deadlock ( due to "std::lock_guard<std::mutex> lock(backup_mutex);") on the 2nd main thread’s entry and causing the crash. Here the explanation: "If lock is called by a thread that already owns the mutex, the behavior is undefined: for example, the program may deadlock." ref: https://en.cppreference.com/w/cpp/thread/mutex/lock Using SendMessage instead of PostMessage ensures that the thread executes the task from the beginning to the end and keeps the mutex until the entire operation is terminated. Therefore, the race condition is prevented by the mutex lock while the 2nd thread tries to access the same code/zone. Fix #14906, close #14917 |
||
---|---|---|
.. | ||
Test | ||
bin | ||
gcc | ||
installer | ||
misc/chameleon | ||
scintilla.original.forUpdating | ||
src | ||
visual.net |