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 @@
#include <tools/link.hxx>
#include <osl/mutex.hxx>
class Timer;
class Idle;
struct ImplSVEvent;
namespace svtools {
......@@ -34,7 +34,7 @@ class SVT_DLLPUBLIC AsynchronLink
{
Link _aLink;
ImplSVEvent * _nEventId;
Timer* _pTimer;
Idle* _pIdle;
bool _bInCall;
bool* _pDeleted;
void* _pArg;
......@@ -47,7 +47,7 @@ public:
AsynchronLink( const Link& rLink )
: _aLink( rLink )
, _nEventId( 0 )
, _pTimer( 0 )
, _pIdle( 0 )
, _bInCall( false )
, _pDeleted( 0 )
, _pArg( 0 )
......@@ -55,7 +55,7 @@ public:
{}
AsynchronLink()
: _nEventId( 0 )
, _pTimer( 0 )
, _pIdle( 0 )
, _bInCall( false )
, _pDeleted( 0 )
, _pArg( 0 )
......
......@@ -46,7 +46,7 @@ bAllowDoubles
{
_pArg = pObj;
DBG_ASSERT( bAllowDoubles ||
( !_nEventId && ( !_pTimer || !_pTimer->IsActive() ) ),
( !_nEventId && ( !_pIdle || !_pIdle->IsActive() ) ),
"Schon ein Call unterwegs" );
if( _nEventId )
{
......@@ -54,17 +54,17 @@ bAllowDoubles
Application::RemoveUserEvent( _nEventId );
if( _pMutex ) _pMutex->release();
}
if( _pTimer )_pTimer->Stop();
if( _pIdle )_pIdle->Stop();
if( bUseTimer )
{
if( !_pTimer )
if( !_pIdle )
{
_pTimer = new Timer;
_pTimer->SetTimeout( 0 );
_pTimer->SetTimeoutHdl( STATIC_LINK(
_pIdle = new Idle;
_pIdle->SetPriority( VCL_IDLE_PRIORITY_HIGHEST );
_pIdle->SetIdleHdl( STATIC_LINK(
this, AsynchronLink, HandleCall) );
}
_pTimer->Start();
_pIdle->Start();
}
else
{
......@@ -81,7 +81,7 @@ AsynchronLink::~AsynchronLink()
{
Application::RemoveUserEvent( _nEventId );
}
delete _pTimer;
delete _pIdle;
if( _pDeleted ) *_pDeleted = true;
delete _pMutex;
}
......@@ -104,7 +104,7 @@ void AsynchronLink::ClearPendingCall()
_nEventId = 0;
}
if( _pMutex ) _pMutex->release();
if( _pTimer ) _pTimer->Stop();
if( _pIdle ) _pIdle->Stop();
}
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