include/systools/win32/retry_if_failed.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 158e43c438049fa5d3c28dbcc3edfbfe11021aac Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Jan 8 06:26:51 2025 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Jan 8 07:31:40 2025 +0100 Fix naming of the argument Change-Id: Ice5ab90ddfee0e1273e0607cb1c3251b1435b6dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179924 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/include/systools/win32/retry_if_failed.hxx b/include/systools/win32/retry_if_failed.hxx index 1372843ab8a6..7d01a1d2a3f7 100644 --- a/include/systools/win32/retry_if_failed.hxx +++ b/include/systools/win32/retry_if_failed.hxx @@ -18,19 +18,19 @@ namespace sal::systools { // Some system calls (e.g., clipboard access functions) may fail first time, because the resource // may only be accessed by one process at a time. This function allows to retry failed call up to -// specified number of times with a specified timeout (in ms), until the call succeeds or the limit +// specified number of times with a specified interval (in ms), until the call succeeds or the limit // of attempts is exceeded. // Usage: // HRESULT hr = sal::systools::RetryIfFailed(10, 100, []{ return OleFlushClipboard(); }); template <typename Func> std::enable_if_t<std::is_same_v<std::invoke_result_t<Func>, HRESULT>, HRESULT> -RetryIfFailed(unsigned times, unsigned msTimeout, Func func) +RetryIfFailed(unsigned times, unsigned msInterval, Func func) { for (unsigned i = 0;; ++i) { if (HRESULT hr = func(); SUCCEEDED(hr) || i >= times) return hr; - Sleep(msTimeout); + Sleep(msInterval); } } }