From 78090581d246cd391d99575680b5b8f8d9de7840 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 28 Jul 2024 14:07:49 +0100 Subject: restore WakeUpThread::joinThread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit removed with: commit 4aa2cc878dae3b34b16ccacd9358fda5e6d6a197 loplugin:unusedmethods Change-Id: Ie6006defdfdab23aef0fa9d9b66b125862b760f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171139 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- framework/source/helper/wakeupthread.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'framework/source') diff --git a/framework/source/helper/wakeupthread.cxx b/framework/source/helper/wakeupthread.cxx index 9a9fc37f7442..63d52a82da76 100644 --- a/framework/source/helper/wakeupthread.cxx +++ b/framework/source/helper/wakeupthread.cxx @@ -88,6 +88,13 @@ public: } } + static void startThread() + { + std::unique_lock g(getMutex()); + if (!updatables.empty() && !wakeupThread) + wakeupThread = new SharedWakeUpThread(); + } + void stopWithLock(std::unique_lock& g) { terminate = true; @@ -135,6 +142,12 @@ public: if (updatables.empty()) disposeThreadWithLock(g); } + + static void joinThread() + { + std::unique_lock g(getMutex()); + disposeThreadWithLock(g); + } }; rtl::Reference SharedWakeUpThread::wakeupThread; @@ -143,6 +156,8 @@ std::vector> SharedWakeUpThread:: namespace framework { +/* static */ void WakeUpThread::startThread() { SharedWakeUpThread::startThread(); } + WakeUpThread::WakeUpThread(css::uno::Reference const& up) : _updatable(up) { @@ -152,6 +167,8 @@ WakeUpThread::WakeUpThread(css::uno::Reference const& up) void WakeUpThread::stop() { SharedWakeUpThread::remove(_updatable); } +/* static */ void WakeUpThread::joinThread() { SharedWakeUpThread::joinThread(); } + } // namespace framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit