diff --git a/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp b/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp index 0f31c3db..9b333b70 100644 --- a/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp +++ b/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp @@ -40,6 +40,7 @@ #include "utils/polling.hpp" #include "utils/string.hpp" #include "utils/time.hpp" +#include "utils/timeout.hpp" #include "utils/utils.hpp" namespace repertory { @@ -133,7 +134,9 @@ auto winfsp_drive::winfsp_service::OnStart(ULONG /*Argc*/, PWSTR * /*Argv*/) auto winfsp_drive::winfsp_service::OnStop() -> NTSTATUS { REPERTORY_USES_FUNCTION_NAME(); + timeout stop_timeout([]() { app_config::set_stop_requested(); }, 30s); host_.Unmount(); + stop_timeout.disable(); if (not lock_.set_mount_state(false, "", -1)) { utils::error::raise_error(function_name, "failed to set mount state"); diff --git a/repertory/librepertory/src/file_manager/cache_size_mgr.cpp b/repertory/librepertory/src/file_manager/cache_size_mgr.cpp index 974004a0..ce7d1e09 100644 --- a/repertory/librepertory/src/file_manager/cache_size_mgr.cpp +++ b/repertory/librepertory/src/file_manager/cache_size_mgr.cpp @@ -70,7 +70,7 @@ auto cache_size_mgr::expand(std::uint64_t size) -> api_error { max_cache_size); last_cache_size = cache_size_; } - notify_.wait(lock, 5s); + notify_.wait_for(lock, 5s); } notify_.notify_all();