Kaydet (Commit) ab14edef authored tarafından Tobias Madl's avatar Tobias Madl

changed Timer tp idle

Change-Id: Ia3e76239ba98530547e057bebfda767ad684730b
üst 5163d6b5
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <tools/link.hxx> #include <tools/link.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
class Timer; class Idle;
struct ImplSVEvent; struct ImplSVEvent;
namespace svtools { namespace svtools {
...@@ -34,7 +34,7 @@ class SVT_DLLPUBLIC AsynchronLink ...@@ -34,7 +34,7 @@ class SVT_DLLPUBLIC AsynchronLink
{ {
Link _aLink; Link _aLink;
ImplSVEvent * _nEventId; ImplSVEvent * _nEventId;
Timer* _pTimer; Idle* _pIdle;
bool _bInCall; bool _bInCall;
bool* _pDeleted; bool* _pDeleted;
void* _pArg; void* _pArg;
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
AsynchronLink( const Link& rLink ) AsynchronLink( const Link& rLink )
: _aLink( rLink ) : _aLink( rLink )
, _nEventId( 0 ) , _nEventId( 0 )
, _pTimer( 0 ) , _pIdle( 0 )
, _bInCall( false ) , _bInCall( false )
, _pDeleted( 0 ) , _pDeleted( 0 )
, _pArg( 0 ) , _pArg( 0 )
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
{} {}
AsynchronLink() AsynchronLink()
: _nEventId( 0 ) : _nEventId( 0 )
, _pTimer( 0 ) , _pIdle( 0 )
, _bInCall( false ) , _bInCall( false )
, _pDeleted( 0 ) , _pDeleted( 0 )
, _pArg( 0 ) , _pArg( 0 )
......
...@@ -46,7 +46,7 @@ bAllowDoubles ...@@ -46,7 +46,7 @@ bAllowDoubles
{ {
_pArg = pObj; _pArg = pObj;
DBG_ASSERT( bAllowDoubles || DBG_ASSERT( bAllowDoubles ||
( !_nEventId && ( !_pTimer || !_pTimer->IsActive() ) ), ( !_nEventId && ( !_pIdle || !_pIdle->IsActive() ) ),
"Schon ein Call unterwegs" ); "Schon ein Call unterwegs" );
if( _nEventId ) if( _nEventId )
{ {
...@@ -54,17 +54,17 @@ bAllowDoubles ...@@ -54,17 +54,17 @@ bAllowDoubles
Application::RemoveUserEvent( _nEventId ); Application::RemoveUserEvent( _nEventId );
if( _pMutex ) _pMutex->release(); if( _pMutex ) _pMutex->release();
} }
if( _pTimer )_pTimer->Stop(); if( _pIdle )_pIdle->Stop();
if( bUseTimer ) if( bUseTimer )
{ {
if( !_pTimer ) if( !_pIdle )
{ {
_pTimer = new Timer; _pIdle = new Idle;
_pTimer->SetTimeout( 0 ); _pIdle->SetPriority( VCL_IDLE_PRIORITY_HIGHEST );
_pTimer->SetTimeoutHdl( STATIC_LINK( _pIdle->SetIdleHdl( STATIC_LINK(
this, AsynchronLink, HandleCall) ); this, AsynchronLink, HandleCall) );
} }
_pTimer->Start(); _pIdle->Start();
} }
else else
{ {
...@@ -81,7 +81,7 @@ AsynchronLink::~AsynchronLink() ...@@ -81,7 +81,7 @@ AsynchronLink::~AsynchronLink()
{ {
Application::RemoveUserEvent( _nEventId ); Application::RemoveUserEvent( _nEventId );
} }
delete _pTimer; delete _pIdle;
if( _pDeleted ) *_pDeleted = true; if( _pDeleted ) *_pDeleted = true;
delete _pMutex; delete _pMutex;
} }
...@@ -104,7 +104,7 @@ void AsynchronLink::ClearPendingCall() ...@@ -104,7 +104,7 @@ void AsynchronLink::ClearPendingCall()
_nEventId = 0; _nEventId = 0;
} }
if( _pMutex ) _pMutex->release(); if( _pMutex ) _pMutex->release();
if( _pTimer ) _pTimer->Stop(); if( _pIdle ) _pIdle->Stop();
} }
void AsynchronLink::Call_Impl( void* pArg ) void AsynchronLink::Call_Impl( void* pArg )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment