diff options
author | Arnaud VERSINI <arnaud.versini@libreoffice.org> | 2022-11-06 17:04:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-01-09 08:37:35 +0000 |
commit | 555f4333182abd0ca4aa06b354763f6dfbc3eb20 (patch) | |
tree | 6f7e2ad77cd297782b8b91ad95f44ce78fc2c130 /desktop | |
parent | 42d9077fc4ffc35d769412a979d91e836adb2536 (diff) |
use std::this_thread::sleep_for instead of osl equivalent
Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 16 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_misc.cxx | 3 |
2 files changed, 6 insertions, 13 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 45b8906c3b42..74f838939bfa 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -48,6 +48,7 @@ #include <cassert> #include <cstdlib> #include <memory> +#include <thread> #if ENABLE_DBUS #include <dbus/dbus.h> @@ -792,10 +793,7 @@ RequestHandler::Status PipeIpcThread::enable(rtl::Reference<IpcThread> * thread) else { // Pipe connection failed (other office exited or crashed) - TimeValue tval; - tval.Seconds = 0; - tval.Nanosec = 500000000; - salhelper::Thread::wait( tval ); + std::this_thread::sleep_for( std::chrono::milliseconds(500) ); } } else @@ -805,10 +803,7 @@ RequestHandler::Status PipeIpcThread::enable(rtl::Reference<IpcThread> * thread) return RequestHandler::IPC_STATUS_PIPE_ERROR; // Wait for second office to be ready - TimeValue aTimeValue; - aTimeValue.Seconds = 0; - aTimeValue.Nanosec = 10000000; // 10ms - salhelper::Thread::wait( aTimeValue ); + std::this_thread::sleep_for( std::chrono::milliseconds(10) ); } } while ( nPipeMode == PIPEMODE_DONTKNOW ); @@ -1206,10 +1201,7 @@ void PipeIpcThread::execute() } SAL_WARN( "desktop.app", "Error on accept: " << static_cast<int>(nError)); - TimeValue tval; - tval.Seconds = 1; - tval.Nanosec = 0; - salhelper::Thread::wait( tval ); + std::this_thread::sleep_for( std::chrono::seconds(1) ); } } while( schedule() ); } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 2983de24b959..bbe3a085fc68 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/task/OfficeRestartManager.hpp> #include <memory> #include <string_view> +#include <thread> #include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <salhelper/linkhelper.hxx> @@ -447,7 +448,7 @@ Reference<XInterface> resolveUnoURL( catch (const connection::NoConnectException &) { if (i < 40) { - ::osl::Thread::wait( std::chrono::milliseconds(500) ); + std::this_thread::sleep_for( std::chrono::milliseconds(500) ); } else throw; } |