summaryrefslogtreecommitdiff
path: root/include/vcl/task.hxx
AgeCommit message (Collapse)Author
2019-12-24sal_Char->char in vclNoel Grandin
Change-Id: I4359b7042f98586e2c9f5529d83d769cdf3d033c Reviewed-on: https://gerrit.libreoffice.org/85775 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-20loplugin:virtualdead unused param in Task::UpdateMinPeriodNoel Grandin
Change-Id: Ie24f56fed811b3b317d6c20e15289e7cecfb738d Reviewed-on: https://gerrit.libreoffice.org/81157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-10tdf#42949 Fix IWYU warnings in include/vclGabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. There were some changes since last run and some omitted files Change-Id: I666ac8ed7d06684e252ca590e3d7d454e9e10975 Reviewed-on: https://gerrit.libreoffice.org/70497 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-03-14Fix scheduled Task priority change handlingJan-Marek Glogowski
If a task is still in the scheduler priority queue and its priority is changed, it won't be moved into the correct queue. We have to track the priority of the scheduled task, so we can warn the developer to fix the code and actually handle re-start correctly. Since we don't want to traverse the whole Scheduler queues on priority change (which sometimes get very long) to remove the wrong data item, we'll just invalidate it, if a priority change is detected. This also reverts commit d24b264c4a47 ("vcl opengl: avoid task priority warning on cursor blink"), which tried to avoid the warning, which was just half right and independent of the broken priority change handling. LO doesn't change priorities of scheduled tasks normally, so that bug didn't turn out to have much impact, I guess. Change-Id: I6e46b518a7c3532047c619c013bd8597f73ed7a6 Reviewed-on: https://gerrit.libreoffice.org/69249 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-12-20tdf#42949 Fix IWYU warnings in include/vcl/[t-u]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib32ea54a3fa690a0722fa75ddb4121ec78c0b64f Reviewed-on: https://gerrit.libreoffice.org/65386 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-09-24Scheduler: add per-priority Task listsJan-Marek Glogowski
This way we don't have to search the whole list for a higher priority event, if an immediate Task is found. This probably helps bugs like tdf#119724 and tdf#119428. Change-Id: Ic5685193d1bedb6996cf46f0ee2cba42190ff7cc Reviewed-on: https://gerrit.libreoffice.org/60572 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-08-29Fix typo: s/an other/another/gAndrea Gelmini
Change-Id: Ifd83affcb16209f4134c725640fbd95077c8ab0f Reviewed-on: https://gerrit.libreoffice.org/59099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-21Workaround static Task destruction errorJan-Marek Glogowski
A task has to get the SchedulerLock to remove itself from the Scheduler list. This doesn't work, if the Task is static, as the static Scheduler might be destroyed earlier. In this case we fail with the following backtrace: #0 SchedulerMutex::acquire #1 Task::~Task #2 __run_exit_handlers Thanks to Michael Stahl to catching this backtrace. As a workaround this marks static tasks, so they ignore the SchedulerMutex in the destructor, We also mark all scheduled Tasks as "static" in DeInitScheduler, as their cleanup was already done. In the end all Tasks should be removed from static objects. Change-Id: I38be3206378b9449193efaccbc96896ac8de9478 Reviewed-on: https://gerrit.libreoffice.org/42574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-07-13Reorganize Scheduler priority classesJan-Marek Glogowski
This is based on glibs classification of tasks, but while glib uses an int for more fine grained priority, we stay with our enum. 1. Timers start with DEFAULT priority, which directly corresponds with the previous HIGH priority 2. Idles start with DEFAULT_IDLE priority instead of the previous HIGH priority, so idle default becomes "really run when idle". As RESIZE and REPAINT are special, and the DEFAULTS are set, there is just one primary decision for the programmer: should my idle run before paint (AKA HIGH_IDLE)? If we really need a more fine-grained classification, we can add it later, or also switch to a real int. As a result, this drops many classifications from the code and drastically changes behaviour, AKA a mail merge from KDE is now as fast as Gtk+ again. Change-Id: I498a73fd02d5fb6f5d7e9f742f3bce972de9b1f9
2017-07-13Drop Task::ReadyForScheduleJan-Marek Glogowski
All relevant information is also provided by UpdateMinPeriod and the calculations were even duplicated. This also includes dropping Scheduler::UpdateMinPeriod, as this is now reduced to a simple comparison and assignment, as we simply ignore larger returned sleep times. Change-Id: I13852e3e63daead451bf7fcb98be9b1d44bd7abd
2017-07-13Drop special idle handlingJan-Marek Glogowski
Idles are just instant timers, which should most time have a low priority, By dropping most special idle handling we'll just schedule by priority. This also reverts SalYieldResult back to a bool, which just indicates if any event was processed. Change-Id: Ia0b91b06dffb77af066f01838d8f9483523bf67d
2017-07-13Just walk the task list onceJan-Marek Glogowski
This refactors some more scheduler code by merging the code from ProcessTaskScheduling into CalculateMinimumTimeout and keeping the ProcessTaskScheduling name. It replace the bHasPendingIdles information with a HasPendingTasks function, based on the sleep timeout and invoke time. To drop IsIdle() we simply account Idles again and stop the system timer, so we instantly run our application loop again. This makes all Tasks really run immediate instead of waiting 1ms. Change-Id: I690a8754e6b115a53e74ef777e988b66b4e5037f
2017-07-13Move scheduler task into its own headerJan-Marek Glogowski
Change-Id: I54534787b8cfa4c47dc09dde9c38a7893df9d367