[Libreoffice-commits] .: 2 commits - comphelper/inc comphelper/source dbaccess/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Thu Feb 16 10:02:24 PST 2012


 comphelper/inc/comphelper/asyncnotification.hxx           |   11 +----------
 comphelper/source/misc/asyncnotification.cxx              |    4 ++--
 dbaccess/source/core/dataaccess/documenteventnotifier.cxx |    1 +
 3 files changed, 4 insertions(+), 12 deletions(-)

New commits:
commit 81921bec4b81b7e3e87c24a6b4e3cfdd0cced47d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 16 19:00:40 2012 +0100

    Make sure spawned thread is joined again
    
    ...otherwise, it might still run during exit(3) and cause problems.

diff --git a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
index 8d6b90d..24a46a2 100644
--- a/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
+++ b/dbaccess/source/core/dataaccess/documenteventnotifier.cxx
@@ -165,6 +165,7 @@ namespace dbaccess
         {
             m_pEventBroadcaster->removeEventsForProcessor( this );
             m_pEventBroadcaster->terminate();
+            m_pEventBroadcaster->join();
             m_pEventBroadcaster = NULL;
         }
 
commit 4a98b359d8ba392362ac6a40692912b58a3b1544
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 16 18:59:38 2012 +0100

    Clean up AsyncEventNotifier interface

diff --git a/comphelper/inc/comphelper/asyncnotification.hxx b/comphelper/inc/comphelper/asyncnotification.hxx
index 6f2f1af..e7d5ac3 100644
--- a/comphelper/inc/comphelper/asyncnotification.hxx
+++ b/comphelper/inc/comphelper/asyncnotification.hxx
@@ -91,7 +91,6 @@ namespace comphelper
     //====================================================================
     //= AsyncEventNotifier
     //====================================================================
-    typedef ::osl::Thread  AsyncEventNotifier_TBASE;
     struct EventNotifierImpl;
 
     /** a helper class for notifying events asynchronously
@@ -110,7 +109,7 @@ namespace comphelper
         events in the queue. As soon as you add an event, the thread is woken up, processes the event,
         and sleeps again.
     */
-    class COMPHELPER_DLLPUBLIC AsyncEventNotifier   :protected AsyncEventNotifier_TBASE
+    class COMPHELPER_DLLPUBLIC AsyncEventNotifier   :public ::osl::Thread
                                                     ,public ::rtl::IReference
     {
         friend struct EventNotifierImpl;
@@ -118,7 +117,6 @@ namespace comphelper
     private:
         ::std::auto_ptr< EventNotifierImpl >        m_pImpl;
 
-    protected:
         // Thread
         virtual void SAL_CALL run();
         virtual void SAL_CALL onTerminated();
@@ -132,13 +130,6 @@ namespace comphelper
         virtual oslInterlockedCount SAL_CALL acquire();
         virtual oslInterlockedCount SAL_CALL release();
 
-        using AsyncEventNotifier_TBASE::create;
-        using AsyncEventNotifier_TBASE::join;
-        using AsyncEventNotifier_TBASE::getIdentifier;
-
-        using AsyncEventNotifier_TBASE::operator new;
-        using AsyncEventNotifier_TBASE::operator delete;
-
         /** terminates the thread
 
             Note that this is a cooporative termination - if you call this from a thread different
diff --git a/comphelper/source/misc/asyncnotification.cxx b/comphelper/source/misc/asyncnotification.cxx
index 7e225ed..cf8b628 100644
--- a/comphelper/source/misc/asyncnotification.cxx
+++ b/comphelper/source/misc/asyncnotification.cxx
@@ -171,7 +171,7 @@ namespace comphelper
         ::osl::MutexGuard aGuard( m_pImpl->aMutex );
 
         // remember the termination request
-        AsyncEventNotifier_TBASE::terminate();
+        Thread::terminate();
 
         // awake the thread
         m_pImpl->aPendingActions.set();
@@ -251,7 +251,7 @@ namespace comphelper
     //--------------------------------------------------------------------
     void SAL_CALL AsyncEventNotifier::onTerminated()
     {
-        AsyncEventNotifier_TBASE::onTerminated();
+        Thread::onTerminated();
         // when we were started (->run), we aquired ourself. Release this now
         // that we were finally terminated
         release();


More information about the Libreoffice-commits mailing list