• Michael Stahl's avatar
    comphelper,vcl: let DeInitVCL() join some AsyncEventNotifier threads · a2095b15
    Michael Stahl yazdı
    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/27581Tested-by: 's avatarJenkins <ci@libreoffice.org>
    Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
    a2095b15
Adı
Son kayıt (commit)
Son güncelleme
..
inc Loading commit data...
qa Loading commit data...
source Loading commit data...
uiconfig Loading commit data...
util Loading commit data...
win32/source/odbcconfig Loading commit data...
AllLangResTarget_dba.mk Loading commit data...
AllLangResTarget_dbmm.mk Loading commit data...
AllLangResTarget_dbu.mk Loading commit data...
AllLangResTarget_sdbt.mk Loading commit data...
CppunitTest_dbaccess_RowSetClones.mk Loading commit data...
CppunitTest_dbaccess_dialog_save.mk Loading commit data...
CppunitTest_dbaccess_embeddeddb_performancetest.mk Loading commit data...
CppunitTest_dbaccess_empty_stdlib_save.mk Loading commit data...
CppunitTest_dbaccess_firebird_test.mk Loading commit data...
CppunitTest_dbaccess_hsqldb_test.mk Loading commit data...
CppunitTest_dbaccess_macros_test.mk Loading commit data...
CppunitTest_dbaccess_nolib_save.mk Loading commit data...
Executable_odbcconfig.mk Loading commit data...
JunitTest_dbaccess_complex.mk Loading commit data...
JunitTest_dbaccess_unoapi.mk Loading commit data...
Library_dba.mk Loading commit data...
Library_dbaxml.mk Loading commit data...
Library_dbmm.mk Loading commit data...
Library_dbu.mk Loading commit data...
Library_sdbt.mk Loading commit data...
Makefile Loading commit data...
Module_dbaccess.mk Loading commit data...
PythonTest_dbaccess_python.mk Loading commit data...
README Loading commit data...
UIConfig_dbaccess.mk Loading commit data...
UIConfig_dbapp.mk Loading commit data...
UIConfig_dbbrowser.mk Loading commit data...
UIConfig_dbquery.mk Loading commit data...
UIConfig_dbrelation.mk Loading commit data...
UIConfig_dbtable.mk Loading commit data...
UIConfig_dbtdata.mk Loading commit data...