LibreOffice Module salhelper (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
salhelper::TimerManager Class Reference
Inheritance diagram for salhelper::TimerManager:
[legend]
Collaboration diagram for salhelper::TimerManager:
[legend]

Public Member Functions

 TimerManager ()
 The timer manager cleanup has been removed (no thread is killed anymore), so the thread leaks. More...
 
void registerTimer (salhelper::Timer *pTimer)
 register timer More...
 
void unregisterTimer (salhelper::Timer const *pTimer)
 unregister timer More...
 
bool lookupTimer (const salhelper::Timer *pTimer)
 lookup timer More...
 

Protected Member Functions

virtual void SAL_CALL run () override
 worker-function of thread More...
 
void checkForTimeout ()
 Checking and triggering of a timer event. More...
 

Protected Attributes

salhelper::Timerm_pHead
 sorted-queue data More...
 
std::mutex m_Lock
 List Protection. More...
 
osl::Condition m_notEmpty
 Signal the insertion of a timer. More...
 

Detailed Description

Definition at line 28 of file timer.cxx.

Constructor & Destructor Documentation

◆ TimerManager()

TimerManager::TimerManager ( )

The timer manager cleanup has been removed (no thread is killed anymore), so the thread leaks.

This will result in a GPF in case the salhelper-library gets unloaded before process termination.

@TODO : rewrite this file, so that the timerManager thread gets destroyed, when there are no timers anymore !

Definition at line 205 of file timer.cxx.

References create(), and m_notEmpty.

Member Function Documentation

◆ checkForTimeout()

void TimerManager::checkForTimeout ( )
protected

◆ lookupTimer()

bool TimerManager::lookupTimer ( const salhelper::Timer pTimer)

lookup timer

Definition at line 271 of file timer.cxx.

References m_Lock, m_pHead, and salhelper::Timer::m_pNext.

◆ registerTimer()

void TimerManager::registerTimer ( salhelper::Timer pTimer)

register timer

Definition at line 214 of file timer.cxx.

References salhelper::Timer::expiresBefore(), m_Lock, m_notEmpty, m_pHead, and salhelper::Timer::m_pNext.

Referenced by checkForTimeout().

◆ run()

void TimerManager::run ( )
overrideprotectedvirtual

worker-function of thread

Definition at line 329 of file timer.cxx.

References checkForTimeout(), salhelper::Timer::getRemainingTime(), m_Lock, m_notEmpty, and m_pHead.

◆ unregisterTimer()

void TimerManager::unregisterTimer ( salhelper::Timer const *  pTimer)

unregister timer

Definition at line 249 of file timer.cxx.

References m_Lock, m_pHead, and salhelper::Timer::m_pNext.

Member Data Documentation

◆ m_Lock

std::mutex salhelper::TimerManager::m_Lock
protected

List Protection.

Definition at line 52 of file timer.cxx.

Referenced by checkForTimeout(), lookupTimer(), registerTimer(), run(), and unregisterTimer().

◆ m_notEmpty

osl::Condition salhelper::TimerManager::m_notEmpty
protected

Signal the insertion of a timer.

Definition at line 54 of file timer.cxx.

Referenced by registerTimer(), run(), and TimerManager().

◆ m_pHead

salhelper::Timer* salhelper::TimerManager::m_pHead
protected

sorted-queue data

Definition at line 50 of file timer.cxx.

Referenced by checkForTimeout(), lookupTimer(), registerTimer(), run(), and unregisterTimer().


The documentation for this class was generated from the following file: