Refactoring of RemovableDriveManager

1) On Windows and Linux, polling of removable drives is done at a background
   thread, not at a UI thread.
2) On OSX, there is no polling, but a OS notification callback.
3) Refactored for clarity of the RemovableDriveManager interface.
This commit is contained in:
bubnikv
2020-03-06 14:49:21 +01:00
parent 408f041076
commit f7b08ca8a9
11 changed files with 640 additions and 753 deletions

View File

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