diff options
author | bubnikv <bubnikv@gmail.com> | 2020-03-06 17:10:58 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2020-03-06 17:10:58 +0300 |
commit | b3b800de656db89d0b50ca574b15eea0796383f7 (patch) | |
tree | fa565ba37d036a30ccfedea6cef713be47bc17f8 /src/slic3r/GUI/Mouse3DController.cpp | |
parent | 85bf78f7e779d838404bef0854bc7c29fd20dbbb (diff) |
Refactoring of RemovableDriveManager:
1) On Windows and Linux, the device enumeration now runs at a background
thread, while it ran on the UI thread on idle, which may have been
blocking on some rare Windows setups, see GH #3515 #3733 #3746 #3766
2) On OSX, the device enumeration now relies on OS callback, no
polling is required.
3) Refactored for cleaner interface.
Diffstat (limited to 'src/slic3r/GUI/Mouse3DController.cpp')
-rw-r--r-- | src/slic3r/GUI/Mouse3DController.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Mouse3DController.cpp b/src/slic3r/GUI/Mouse3DController.cpp index 6781ba9ff..8bc9744f1 100644 --- a/src/slic3r/GUI/Mouse3DController.cpp +++ b/src/slic3r/GUI/Mouse3DController.cpp @@ -451,12 +451,13 @@ void Mouse3DController::shutdown() // Stop the worker thread, if running. { // Notify the worker thread to cancel wait on detection polling. - std::unique_lock<std::mutex> lock(m_stop_condition_mutex); + std::lock_guard<std::mutex> lock(m_stop_condition_mutex); m_stop = true; - m_stop_condition.notify_all(); } + m_stop_condition.notify_all(); // Wait for the worker thread to stop. m_thread.join(); + m_stop = false; } } |