Clean up AsyncEventNotifier interface

This commit is contained in:
Stephan Bergmann
2012-02-16 18:59:38 +01:00
parent 1cc602e09b
commit 4a98b359d8
2 changed files with 3 additions and 12 deletions

View File

@@ -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

View File

@@ -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();