Clean up AsyncEventNotifier interface
This commit is contained in:
@@ -91,7 +91,6 @@ namespace comphelper
|
|||||||
//====================================================================
|
//====================================================================
|
||||||
//= AsyncEventNotifier
|
//= AsyncEventNotifier
|
||||||
//====================================================================
|
//====================================================================
|
||||||
typedef ::osl::Thread AsyncEventNotifier_TBASE;
|
|
||||||
struct EventNotifierImpl;
|
struct EventNotifierImpl;
|
||||||
|
|
||||||
/** a helper class for notifying events asynchronously
|
/** 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,
|
events in the queue. As soon as you add an event, the thread is woken up, processes the event,
|
||||||
and sleeps again.
|
and sleeps again.
|
||||||
*/
|
*/
|
||||||
class COMPHELPER_DLLPUBLIC AsyncEventNotifier :protected AsyncEventNotifier_TBASE
|
class COMPHELPER_DLLPUBLIC AsyncEventNotifier :public ::osl::Thread
|
||||||
,public ::rtl::IReference
|
,public ::rtl::IReference
|
||||||
{
|
{
|
||||||
friend struct EventNotifierImpl;
|
friend struct EventNotifierImpl;
|
||||||
@@ -118,7 +117,6 @@ namespace comphelper
|
|||||||
private:
|
private:
|
||||||
::std::auto_ptr< EventNotifierImpl > m_pImpl;
|
::std::auto_ptr< EventNotifierImpl > m_pImpl;
|
||||||
|
|
||||||
protected:
|
|
||||||
// Thread
|
// Thread
|
||||||
virtual void SAL_CALL run();
|
virtual void SAL_CALL run();
|
||||||
virtual void SAL_CALL onTerminated();
|
virtual void SAL_CALL onTerminated();
|
||||||
@@ -132,13 +130,6 @@ namespace comphelper
|
|||||||
virtual oslInterlockedCount SAL_CALL acquire();
|
virtual oslInterlockedCount SAL_CALL acquire();
|
||||||
virtual oslInterlockedCount SAL_CALL release();
|
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
|
/** terminates the thread
|
||||||
|
|
||||||
Note that this is a cooporative termination - if you call this from a thread different
|
Note that this is a cooporative termination - if you call this from a thread different
|
||||||
|
@@ -171,7 +171,7 @@ namespace comphelper
|
|||||||
::osl::MutexGuard aGuard( m_pImpl->aMutex );
|
::osl::MutexGuard aGuard( m_pImpl->aMutex );
|
||||||
|
|
||||||
// remember the termination request
|
// remember the termination request
|
||||||
AsyncEventNotifier_TBASE::terminate();
|
Thread::terminate();
|
||||||
|
|
||||||
// awake the thread
|
// awake the thread
|
||||||
m_pImpl->aPendingActions.set();
|
m_pImpl->aPendingActions.set();
|
||||||
@@ -251,7 +251,7 @@ namespace comphelper
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void SAL_CALL AsyncEventNotifier::onTerminated()
|
void SAL_CALL AsyncEventNotifier::onTerminated()
|
||||||
{
|
{
|
||||||
AsyncEventNotifier_TBASE::onTerminated();
|
Thread::onTerminated();
|
||||||
// when we were started (->run), we aquired ourself. Release this now
|
// when we were started (->run), we aquired ourself. Release this now
|
||||||
// that we were finally terminated
|
// that we were finally terminated
|
||||||
release();
|
release();
|
||||||
|
Reference in New Issue
Block a user