diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-07-28 14:07:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-07-28 16:35:14 +0200 |
commit | 78090581d246cd391d99575680b5b8f8d9de7840 (patch) | |
tree | 21cd57e7f2eef83d589f59145952e99b37ff5ea0 /framework/source | |
parent | 21250dc9c5787d9274837b2bf39c32c2627e44b4 (diff) |
restore WakeUpThread::joinThread
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 <caolan.mcnamara@collabora.com>
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/helper/wakeupthread.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
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<std::mutex>& 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> SharedWakeUpThread::wakeupThread; @@ -143,6 +156,8 @@ std::vector<css::uno::WeakReference<css::util::XUpdatable>> SharedWakeUpThread:: namespace framework { +/* static */ void WakeUpThread::startThread() { SharedWakeUpThread::startThread(); } + WakeUpThread::WakeUpThread(css::uno::Reference<css::util::XUpdatable> const& up) : _updatable(up) { @@ -152,6 +167,8 @@ WakeUpThread::WakeUpThread(css::uno::Reference<css::util::XUpdatable> const& up) void WakeUpThread::stop() { SharedWakeUpThread::remove(_updatable); } +/* static */ void WakeUpThread::joinThread() { SharedWakeUpThread::joinThread(); } + } // namespace framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |