diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-07-26 23:42:36 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-07-29 10:05:47 +0000 |
commit | a2095b151409f0fb57aa8feaa4c6282f84040245 (patch) | |
tree | 08d70dc7853bb2eafa69bf3cb8c9eceb7df2e5fd /svx/qa | |
parent | b3b7669e7fb74b04d925f21a7f0b048434eeffa3 (diff) |
comphelper,vcl: let DeInitVCL() join some AsyncEventNotifier threads
comphelper::AsyncEventNotifier is an amazing class that dispatches
events in separate threads, no doubt implemented during times of
exuberant optimism about the tractability of shared-state
multi-threading.
Unfortunately the authors forgot to think about how all those awesome
threads will be joined, so if they are somehow blocked, then it may well
happen that the events are dispatched when the main thread is already in
DeInitVCL, and the objects required for the dispatching already smell
somewhat funny.
This happens quite reproducibly when changing dbaccess' ModelMethodGuard
to lock the SolarMutex too, then CppunitTest_dbaccess_RowSetClones
crashes in DeInitVCL() because one AsyncEventNotifier thread was blocked
until then by SolarMutexGuard, and this test never Yields once its
document is loaded.
Try to fix this by joining the "DocumentEventNotifier" threads from
DeInitVCL() itself.
Since there's no rtl::WeakReference to go with rtl::Reference, refactor
the AsyncEventNotifier and create a new AsyncEventNotifierAutoJoin
that has to be used with std::shared_ptr and std::weak_ptr.
Change-Id: I50a0749795acb04b0776e543f7125767b697ea35
Reviewed-on: https://gerrit.libreoffice.org/27581
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svx/qa')
0 files changed, 0 insertions, 0 deletions