summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtimerinfo_unix_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Export QTimerInfoListBradley T. Hughes2012-01-091-1/+1
| | | | | | | | | ... so that QCocoaEventDispatcher can use it to implement timer handling and benefit from the Qt::TimerType support in QTimerInfoList. Change-Id: I34b81502465963e2c9d528df463fa2eccd275ad6 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimerInfo::expected is only needed for debuggingBradley T. Hughes2012-01-061-1/+1
| | | | | | | | | The code for calculating the expected time is only useful for debugging purposes. Don't compile this into the library unless QTIMERINFO_DEBUG is defined. Change-Id: I6530e6a70410a12544410ef286225df98ceddcee Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Do not always compile in QTimerInfoList::repairTimers()Bradley T. Hughes2012-01-051-1/+1
| | | | | | | | | | | | This function is never called on systems that are guaranteed to have a monotonic click (like Mac OS X). Remove the dead code from the library. Change-Id: I95852c8dffaa3a9747367f0abe4a4c62e4f86421 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Use Qt::TimerType on UNIX when scheduling timersBradley T. Hughes2012-01-051-1/+9
| | | | | | | | | | | | | | | | As stated in the documentation for Qt::TimerType, we allow for up to 5% error for CoarseTimers (the default timer type). PreciseTimers are not adjusted at all, and VeryCoarseTimers fire with one-second accuracy. The objective is to make most timers wake up at the same time, thereby reducing CPU wakeups. Note that this changes makes it possible for timers to fire early, which may be unexpected for some applications. Such applications should use PreciseTimers explicitly. Author: Thiago Macieira <thiago.macieira@nokia.com> Change-Id: Iaa70314c39a446adbc6dbb6fdfa7bafcd98a7283 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Change QTimerInfo (UNIX) to keep the interval in milliseconds.Bradley T. Hughes2012-01-021-1/+1
| | | | | | | | | | The API passes the interval as an int, there's no reason to convert it to a timeval struct. This also prepares for changing the UNIX timer code to support the different timer types. Author: Thiago Macieira <thiago.macieira@nokia.com> Change-Id: Ie3cc1ae8f1be6a9ad3f1766051642cbf3e614418 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Qt::TimerType argument to QAbstractEventDispatcher::registerTimer()Bradley T. Hughes2012-01-021-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | ... and deprecate the old registerTimer() functions. The new pure- virtual registerTimer() breaks source-compatibility. Subclasses cannot be instantiated anymore, since the pure virtual function signature has changed. QAbstractEventDispatcher::TimerInfo is no longer a QPair. It is now a struct with timerId, interval, and timerType members. This is a source incompatibility that should only affect subclasses of QAbstractEventDispatcher, which will need to pass 3 arguments to the TimerInfo constructor instead of 2. If the subclass used QPair<int,int> instead of the TimerInfo typedef, the QPair<int,int> declarations will need to be replaced with TimerInfo. Call the new registerTimer() function with the type from QObject::startTimer(). Change all subclasses of QAbstractEventDispatcher to reimplement the new virtual function. The type argument is unused at the momemnt, except to ensure that registeredTimers() returns the type each timer was registered with. Implementations for the various dispatchers will be done in separate commits. Author: Thiago Macieira <thiago.macieira@nokia.com> Change-Id: Ia22697e0ab0847810c5d162ef473e0e5a17a904b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Split timer handling out of QEventDispatcherUnix.Robin Burchell2011-12-151-0/+110
This makes it easier to see the guts of the unix event dispatcher, and to experiment with it. Change-Id: I715bb68c4de6798e10bc55304a128b88e0249c63 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>