diff options
author | bubnikv <bubnikv@gmail.com> | 2020-03-12 13:30:51 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2020-03-12 13:30:58 +0300 |
commit | c145d60df437447f16d06be9b85fa90df0e58185 (patch) | |
tree | 55f147048c191e1acefe135bc2737cd2de1aef75 /src/slic3r/GUI/RemovableDriveManager.hpp | |
parent | 29f2394ecbb6586965bf86e26e989b4e3f150329 (diff) |
Improvement in the RemovableDriveManager update function:
Don't call the update() if it is already running. Wait for the
other instance to finish instead.
Diffstat (limited to 'src/slic3r/GUI/RemovableDriveManager.hpp')
-rw-r--r-- | src/slic3r/GUI/RemovableDriveManager.hpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index 8b661d19c..c12f2dd0a 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -102,6 +102,8 @@ private: // sorted ascending by path std::vector<DriveData> m_current_drives; mutable tbb::mutex m_drives_mutex; + // Locking the update() function to avoid that the function is executed multiple times. + mutable tbb::mutex m_inside_update_mutex; // Returns drive path (same as path in DriveData) if exists otherwise empty string. std::string get_removable_drive_from_path(const std::string& path); |