summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-02-23 10:37:09 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-02-23 10:47:37 +0100
commit2eaa1422a032d6a7ffc72a2abeb3dd3e6248a263 (patch)
treea8a618394c09b21cd189a4f9f221557dc5fc628a /comphelper/source
parent40d21ab3c75a7c18de940162563015ae80136709 (diff)
Adapted AsyncEventNotifier to safer-to-use salhelper::Thread
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/misc/asyncnotification.cxx37
1 files changed, 3 insertions, 34 deletions
diff --git a/comphelper/source/misc/asyncnotification.cxx b/comphelper/source/misc/asyncnotification.cxx
index cf8b6286d97b..216cdb2f765f 100644
--- a/comphelper/source/misc/asyncnotification.cxx
+++ b/comphelper/source/misc/asyncnotification.cxx
@@ -142,8 +142,8 @@ namespace comphelper
//= AsyncEventNotifier
//====================================================================
//--------------------------------------------------------------------
- AsyncEventNotifier::AsyncEventNotifier()
- :m_pImpl( new EventNotifierImpl )
+ AsyncEventNotifier::AsyncEventNotifier(char const * name):
+ Thread(name), m_pImpl(new EventNotifierImpl)
{
}
@@ -191,13 +191,8 @@ namespace comphelper
}
//--------------------------------------------------------------------
- void AsyncEventNotifier::run()
+ void AsyncEventNotifier::execute()
{
- acquire();
-
- // keep us alive, in case we're terminated in the mid of the following
- ::rtl::Reference< AsyncEventNotifier > xKeepAlive( this );
-
do
{
AnyEventRef aNextEvent;
@@ -248,32 +243,6 @@ namespace comphelper
while ( sal_True );
}
- //--------------------------------------------------------------------
- void SAL_CALL AsyncEventNotifier::onTerminated()
- {
- Thread::onTerminated();
- // when we were started (->run), we aquired ourself. Release this now
- // that we were finally terminated
- release();
- }
-
- //--------------------------------------------------------------------
- oslInterlockedCount SAL_CALL AsyncEventNotifier::acquire()
- {
- return osl_incrementInterlockedCount( &m_pImpl->m_refCount );
- }
-
- //--------------------------------------------------------------------
- oslInterlockedCount SAL_CALL AsyncEventNotifier::release()
- {
- if ( 0 == osl_decrementInterlockedCount( &m_pImpl->m_refCount ) )
- {
- delete this;
- return 0;
- }
- return m_pImpl->m_refCount;
- }
-
//........................................................................
} // namespace comphelper
//........................................................................