MythTV  0.26-pre
Signals | Public Member Functions | Private Member Functions | Private Attributes
MythSignalingTimer Class Reference

This class is essentially a workaround for a Qt 4.5.2 bug where it will get stuck in the Qt event loop for up to 999 nanoseconds per timer firing. More...

#include <mythsignalingtimer.h>

Inheritance diagram for MythSignalingTimer:
MThread

List of all members.

Signals

void timeout (void)

Public Member Functions

 MythSignalingTimer (QObject *parent, const char *slot)
 ~MythSignalingTimer ()
virtual void stop (void)
virtual void start (int msec)
virtual bool blockSignals (bool block)

Private Member Functions

virtual void run (void)
 Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.

Private Attributes

QMutex startStopLock
volatile bool dorun
volatile bool running
volatile uint64_t microsec

Detailed Description

This class is essentially a workaround for a Qt 4.5.2 bug where it will get stuck in the Qt event loop for up to 999 nanoseconds per timer firing.

This lost millisecond is not a huge issue for infrequent timers, but causes 7% lost CPU in the MythUI animate() handling.

Definition at line 19 of file mythsignalingtimer.h.


Constructor & Destructor Documentation

MythSignalingTimer::MythSignalingTimer ( QObject *  parent,
const char *  slot 
)

Definition at line 23 of file mythsignalingtimer.cpp.

Definition at line 32 of file mythsignalingtimer.cpp.


Member Function Documentation

void MythSignalingTimer::start ( int  msec) [virtual]
virtual bool MythSignalingTimer::blockSignals ( bool  block) [inline, virtual]

Definition at line 30 of file mythsignalingtimer.h.

Referenced by MythMainWindow::animate().

Referenced by MythSignalingTimer(), and run().

void MythSignalingTimer::run ( void  ) [private, virtual]

Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.

Note:
If you override this method you must call RunProlog before you do any work and RunEpilog before you exit the run method.

Reimplemented from MThread.

Definition at line 71 of file mythsignalingtimer.cpp.


Member Data Documentation

Definition at line 39 of file mythsignalingtimer.h.

Referenced by start(), and stop().

volatile bool MythSignalingTimer::dorun [private]

Definition at line 40 of file mythsignalingtimer.h.

Referenced by run(), start(), and stop().

volatile bool MythSignalingTimer::running [private]

Definition at line 41 of file mythsignalingtimer.h.

Referenced by run(), start(), and stop().

Definition at line 42 of file mythsignalingtimer.h.

Referenced by run(), and start().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends