Improvement in the RemovableDriveManager update function:

Don't call the update() if it is already running. Wait for the
other instance to finish instead.
This commit is contained in:
bubnikv 2020-03-12 11:30:51 +01:00
parent 29f2394ecb
commit c145d60df4
2 changed files with 20 additions and 10 deletions

View file

@ -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);