summaryrefslogtreecommitdiff
path: root/include/vcl/timer.hxx
AgeCommit message (Collapse)Author
2017-11-29loplugin:countusersofdefaultparams in include/oox..vclNoel Grandin
Change-Id: If831bce4cd1fe2c5233159b31c239b813629e0de Reviewed-on: https://gerrit.libreoffice.org/45420 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-06Don't run the OLEObjCache timer for an empty cacheJan-Marek Glogowski
Change-Id: I210f6bdec14491bea6d15bca133011059091f21b
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
2017-02-21loplugin:unusedmethodsNoel Grandin
Change-Id: I52a9f16f3ed543a3c83ca111df70e3f7ae1ef33c Reviewed-on: https://gerrit.libreoffice.org/34508 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-23Change all Idle* LINKs to be Timer*Jan-Marek Glogowski
Seem UBSAN doesn't like my forced reinterpret_cast to set the Idles Link in the Timer class. Now there are two possible solution: 1. convert all (DECL|IMPL).*_LINK call sites to use a Timer* or 2. split the inheritance of Idle from Timer again to maintain different Link<>s and move all common code into a TimerBase. While the 1st is more correct, the 2nd has a better indicator for Idles. This implements the first solution. And while at it, this also converts all call sites of SetTimeoutHdl and SetIdleHdl to SetInvokeHandler and gets rid of some local Link objects, which are just passed to the SetInvokeHandler call. It also introduces ClearInvokeHandler() and replaces the respective call sites of SetInvokeHandler( Link<Timer *, void>() ). Change-Id: I40c4167b1493997b7f136add4dad2f4ff5504b69
2017-01-20Apply stricter member access control for TasksJan-Marek Glogowski
This disallows changing mbAuto and changing values of ImplSchedulerData outside of Scheduler / Task functions. Change-Id: Ia624999bd63190c072eb66427aec38e7ac8cfa1b Reviewed-on: https://gerrit.libreoffice.org/33317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-01-17Change Idle to be a Timer subclassJan-Marek Glogowski
Drops a lot of duplicated code, as Idle is just a convenience class for instant, mostly low priority timers. Change-Id: I847592e92e86d15ab1cab168bf0e667322e48048
2017-01-17Refactor Scheduler to add Task classJan-Marek Glogowski
Moves all the "task-specific" stuff into a Task class and just keeps the "real" static Scheduler functions in the original Scheduler class. Change-Id: I9eb02d46e2bcf1abb06af5bab1fa0ee734d1984c
2017-01-17Convert bTimer => bIdleJan-Marek Glogowski
All other places already refer to being Idle, so change the Scheduler::ProcessTaskScheduling argument to bIdle and adapt all other scheduler-related functions. Change-Id: If5a605abbc3e620092127b65ada29f11215a0343
2017-01-17Always schedule with the same timeJan-Marek Glogowski
No need to always update the time - scheduling should be fast! Change-Id: Ic4c01f5a5759ef4970f1385aab6ef93cd67f33b6
2017-01-17tdf#97087 GDB pretty print the Scheduler task listJan-Marek Glogowski
In addition to the GDB pretty printer, this annotates a lot more Timers and Idles. Change-Id: I5b93fab02161b23bb753e65ef92643a04fb0789c
2015-11-25vcl: don't treat non-ready timers as idle handlers.Michael Meeks
Fixes the busy-loop - 100% CPU all the time. Change-Id: I965f62d6a6f2ec1830c0897dd97179a739c70afc Reviewed-on: https://gerrit.libreoffice.org/20186 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-09-04Minor refactoring and cleanup of Scheduler and Timer.Ashod Nakashian
Members are now const-correct. Replaced compile-time constants with enum. Refactored common functions from Timer to Scheduler. Disabled timer-precision unittests as they misfire often. These changes are non-functional. Change-Id: I6bb3d9fc402cadd556d9063ed9a4888f114c73d7 Reviewed-on: https://gerrit.libreoffice.org/17977 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-06-15Revert "std::list for Scheduler"Stephan Bergmann
This reverts commit 1289d3c42af66990a2c8e5a7a38e51b6cd51c7eb, plus follow-ups 762e90ffa0cd5f85dadd9bad93391d105e60e418 "vcl: loplugin:pointertobool" and 863e5685dda88efd0bee3177a08eedffd4730e33 "Fix funny line-ends," as it causes memory corruption, see valgrind "make CppunitTest_sw_ooxmlexport4" output: > Invalid write of size 1 > Scheduler::ImplInvoke(unsigned long) (/vcl/source/app/scheduler.cxx:40) > Scheduler::ProcessTaskScheduling(bool) (/vcl/source/app/scheduler.cxx:128) > Scheduler::CallbackTaskScheduling(bool) (/vcl/source/app/scheduler.cxx:112) > SalTimer::CallCallback(bool) (/vcl/inc/saltimer.hxx:53) > SvpSalInstance::CheckTimeout(bool) (/vcl/headless/svpinst.cxx:191) > SvpSalInstance::Yield(bool, bool) (/vcl/headless/svpinst.cxx:307) > ImplYield(bool, bool) (/vcl/source/app/svapp.cxx:353) > Application::Reschedule(bool) (/vcl/source/app/svapp.cxx:377) > framework::StatusIndicatorFactory::impl_reschedule(bool) (/framework/source/helper/statusindicatorfactory.cxx:528) > framework::StatusIndicatorFactory::end(com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&) (/framework/source/helper/statusindicatorfactory.cxx:229) > framework::StatusIndicator::end() (/framework/source/helper/statusindicator.cxx:70) > non-virtual thunk to framework::StatusIndicator::end() (/framework/source/helper/statusindicator.cxx:57) > writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) (/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:531) > WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:191) > non-virtual thunk to WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:126) > SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) (/sfx2/source/doc/objstor.cxx:2271) > SfxObjectShell::DoLoad(SfxMedium*) (/sfx2/source/doc/objstor.cxx:767) > SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1859) > non-virtual thunk to SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1810) > (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:703) > non-virtual thunk to (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:615) > framework::LoadEnv::impl_loadContent() (/framework/source/loadenv/loadenv.cxx:1122) > framework::LoadEnv::startLoading() (/framework/source/loadenv/loadenv.cxx:383) > framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/framework/source/loadenv/loadenv.cxx:164) > framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/framework/source/services/desktop.cxx:566) > non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/framework/source/services/desktop.cxx:552) > unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/unotest/source/cpp/macros_test.cxx:50) > SwModelTestBase::load(char const*, char const*) (/sw/qa/extras/inc/swmodeltestbase.hxx:580) > SwModelTestBase::executeImportExportImportTest(char const*) (/sw/qa/extras/inc/swmodeltestbase.hxx:219) > testTrackChangesDeletedParagraphMark::Import_Export_Import() (/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx:132) > CppUnit::TestCaller<testTrackChangesDeletedParagraphMark>::runTest() (/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166) > CppUnit::TestCaseMethodFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32) > (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/test/source/vclbootstrapprotector.cxx:57) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (in /home/sbergman/lo/core/workdir/LinkTarget/Library/unobootstrapprotector.so) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77) > CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181) > CppUnit::TestCase::run(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91) > CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64) > CppUnit::TestComposite::run(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23) > CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64) > CppUnit::TestComposite::run(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23) > CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47) > CppUnit::TestResult::runTest(CppUnit::Test*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148) > CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96) > Address 0x2c9ece48 is 40 bytes inside a block of size 104 free'd > operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) > (anonymous namespace)::ImpTimedRefDev::~ImpTimedRefDev() (/drawinglayer/source/primitive2d/textlayoutdevice.cxx:84) > std::default_delete<(anonymous namespace)::ImpTimedRefDev>::operator()((anonymous namespace)::ImpTimedRefDev*) const (/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/bits/unique_ptr.h:76) > std::unique_ptr<(anonymous namespace)::ImpTimedRefDev, std::default_delete<(anonymous namespace)::ImpTimedRefDev> >::reset((anonymous namespace)::ImpTimedRefDev*) (/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../include/c++/4.9.2/bits/unique_ptr.h:344) > comphelper::unique_disposing_ptr<(anonymous namespace)::ImpTimedRefDev>::reset((anonymous namespace)::ImpTimedRefDev*) (/include/comphelper/unique_disposing_ptr.hxx:41) > (anonymous namespace)::ImpTimedRefDev::Invoke() (/drawinglayer/source/primitive2d/textlayoutdevice.cxx:93) > Scheduler::ImplInvoke(unsigned long) (/vcl/source/app/scheduler.cxx:39) > Scheduler::ProcessTaskScheduling(bool) (/vcl/source/app/scheduler.cxx:128) > Scheduler::CallbackTaskScheduling(bool) (/vcl/source/app/scheduler.cxx:112) > SalTimer::CallCallback(bool) (/vcl/inc/saltimer.hxx:53) > SvpSalInstance::CheckTimeout(bool) (/vcl/headless/svpinst.cxx:191) > SvpSalInstance::Yield(bool, bool) (/vcl/headless/svpinst.cxx:307) > ImplYield(bool, bool) (/vcl/source/app/svapp.cxx:353) > Application::Reschedule(bool) (/vcl/source/app/svapp.cxx:377) > framework::StatusIndicatorFactory::impl_reschedule(bool) (/framework/source/helper/statusindicatorfactory.cxx:528) > framework::StatusIndicatorFactory::end(com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&) (/framework/source/helper/statusindicatorfactory.cxx:229) > framework::StatusIndicator::end() (/framework/source/helper/statusindicator.cxx:70) > non-virtual thunk to framework::StatusIndicator::end() (/framework/source/helper/statusindicator.cxx:57) > writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) (/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:531) > WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:191) > non-virtual thunk to WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:126) > SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) (/sfx2/source/doc/objstor.cxx:2271) > SfxObjectShell::DoLoad(SfxMedium*) (/sfx2/source/doc/objstor.cxx:767) > SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1859) > non-virtual thunk to SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1810) > (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:703) > non-virtual thunk to (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:615) > framework::LoadEnv::impl_loadContent() (/framework/source/loadenv/loadenv.cxx:1122) > framework::LoadEnv::startLoading() (/framework/source/loadenv/loadenv.cxx:383) > framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/framework/source/loadenv/loadenv.cxx:164) > framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/framework/source/services/desktop.cxx:566) > non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/framework/source/services/desktop.cxx:552) > unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (/unotest/source/cpp/macros_test.cxx:50) > SwModelTestBase::load(char const*, char const*) (/sw/qa/extras/inc/swmodeltestbase.hxx:580) > SwModelTestBase::executeImportExportImportTest(char const*) (/sw/qa/extras/inc/swmodeltestbase.hxx:219) > testTrackChangesDeletedParagraphMark::Import_Export_Import() (/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx:132) > CppUnit::TestCaller<testTrackChangesDeletedParagraphMark>::runTest() (/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166) > CppUnit::TestCaseMethodFunctor::operator()() const (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32) > (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/test/source/vclbootstrapprotector.cxx:57) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (in /home/sbergman/lo/core/workdir/LinkTarget/Library/unobootstrapprotector.so) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15) > CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in /home/sbergman/lo/core/workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.13.so.0.0.2) > CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77) > CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::string const&) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181) > CppUnit::TestCase::run(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91) > CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (/workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64)
2015-06-12std::list for SchedulerJuergen Funk
Re-factor the scheduler to use std::list Because - ImplSchedulerData - remove: mbInScheduler, mnUpdateTime, mnUpdateStack that is scheduler stuff - this struct is only a container for the scheduler-list - UpdateMinPeriod - the scheduler is the pure-virtual-class then the idle-class must override this method - ImplDeInitScheduler(bool All=true) - this patch 2e29a518b04250b5f9cc9d0d77da3df076834d60 remove all scheduler tasks and the scheduler, but after that, the scheduler is using, then crash. With this fix, only delete the scheduler-list, but not the scheduler The next steps - split the scheduler from the scheduler-list-handling the scheduler-list-handling need a static class - remove the scheduler from the timer-handling staff Change-Id: I8d4d4f27b2bc9684a48c2afafd0b3edd0716c71d Reviewed-on: https://gerrit.libreoffice.org/16148 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-06-10tdf#91727 - Unwind non-dispatch of idle handlers.Michael Meeks
This clobbers the functionality from commit: 06d731428ef6cf93c7333e8228bfb6088853b52f make idle timers actually activate only when idle Since now all rendering and re-sizing is done in idle handlers it does effectively the opposite of what was intended. A better solution would allow special-casing the processing of just rendering, re-sizing and window management to spin for eg. progress bar rendering. Also add helpful debugging labels to the idle & timeouts. Also cleanup the Idle vs. Scheduler handling. Also ensure that starting an Idle triggers a mainloop wakeup. Also add a unit test. Change-Id: Ifb0756714378fdb790be599b93c7a3ac1f9209e6
2015-05-05Use typed Timer::SetTimeoutHdl LinkStephan Bergmann
Change-Id: Iaaf0c93e5b28c0f7dbe4f02eda8beeae30708100
2015-04-30Gradually typed LinkStephan Bergmann
Turn the Link class into a template abstracting over the link's argument and return types, but provide default template arguments that keep the generic, unsafe "void* in, sal_IntPtr out" behvior. That way, individual uses of the Link class can be updated over time. All the related macros are duplicated with ..._TYPED counterparts, that additionally take the RetType (except for LINK_TYPED, which manages to infer the relevant types from the supplied Member). (It would have been attractive to change the "untyped" LinkStubs from taking a void* to a properly typed ArgType parameter, too, but that would cause -fsanitize=function to flag uses of "untyped" Link::Call.) Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-03-11vcl timers: avoid crash initializing too early.Michael Meeks
We need the default instance created first. Change-Id: I95f51e9ec5d9827f2b1b53bcadb1f43c9e637edd
2015-03-11vcl timers: avoid crash with vcldemo.Michael Meeks
The system timer needs earlier and/or more consistent initialization. Change-Id: I148d98537cc055a091181bd36a654ae35f665aaf
2015-03-09Scheduler: Changed uLong to uInt32/uInt64Tobias Madl
Change-Id: Ic60463027c7f1b2d513539adba834b8d8e0ce6d3
2015-03-06Timer: added virtual before definitionTobias Madl
Change-Id: Ief4da1f1241fc4175f5ad132fd103e6d29470b58
2015-03-06adapted comments and variable namesTobias Madl
Change-Id: I4f2c1d743ce2f30e8c24180b73f0716fc13b459e
2015-03-06Timer: added new saltimer handlingTobias Madl
Change-Id: Icdc5abf9dca727a8cc312ddb5861f7a34a38bbe1
2015-03-06Timer: patch for commit 06d7314Tobias Madl
Change-Id: I762062a4782438ec5bbcb53da9a42f44db65c40d
2015-03-06Idle Timer: Invented Base ClassTobias Madl
Change-Id: I03db46afcc0cb5e5d7a134b1bdd327abb542e63c
2015-03-06Optimized Timer/Idle codeTobias Madl
Change-Id: I285bd632faba5a29a770404d6967f4faf7667b16
2015-03-06Scheduling optimization and starving protectionTobias Madl
If a Timeout appears, while the idle scheduling is in progress. The idle scheduler gets interrupted and the timeouts are handled. Now the idle scheduler has a new starving protection. Change-Id: Ic9081c647e3fb0abf3b0dc014e711a3b97e0e37d
2015-03-06Idle: Idle and Timer completely independendTobias Madl
Now the Idle and Timer are divided in two seperate classes. But now all changed idles need a new import, before the programm is working again. Change-Id: I5be7424622b6fcc993c621fa4a11fbee1b6d9bf2
2015-02-04make idle timers actually activate only when idleLuboš Luňák
Without this, they can activate after any call to the event processing, so they may activate in cases such as when updating progressbar while loading a document, or on repeated user input (so things like showing spellchecking get updated when the app is busy redrawing). This change makes idle timers activate only when there's nothing more for the event loop to process. It's a bit of a question if this doesn't break something that happens to expect idle timers to be not-really-idle timers, but oh well. No change for non-X11 platforms, as there's I don't know how to check the event queues. Change-Id: I074a88f2f5eeb4b456a11916a0ec2ad6f54dfbab
2015-01-26followup code removal after changing virtual methods to non-virtualNoel Grandin
This cleanups up indentation and removes dead classes. This is a followup patch to commit 272b1dd55797aacf511fb4342b0054e3697243f6 "new loplugin: change virtual methods to non-virtual" Change-Id: I1c2139589cf8cb23bb9808defe22c51039d38de1
2015-01-26new loplugin: change virtual methods to non-virtualNoel Grandin
Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2014-12-09Michael's patch implementedTobias Madl
Change-Id: I3f0802d5001172fc7b8409274bc5a3632e5dad34
2014-12-09applied patch from Michael MeeksJennifer Liebel
Change-Id: I57f22b6d9bfbef4a50d162076b01e8e64edb4718
2014-11-05idle: implement ProcessAllIdleHandlers.László Németh
It is often useful to flush all pending idle / GUI work for testing and/or profiling - so make that easy to do with this new method. Also tag idle Timers with a boolean, for ease of use. Change-Id: I57e883be8fe8637b3715008e8074d0fa258ca0c3
2014-11-05Basic Idle handler implementationTobias Madl
An idle handler will ultimately be a zero time timeout with prioritisation layered on top of that. Change-Id: I3f0802d5001172fc7b8409274bc5a3632e5dad34
2014-09-25vcl: comment timer classes at least minimally.Michael Meeks
Change-Id: Iabc76b3e78afa491a38fa04d648f48f15ac3870e
2014-05-05simplify ternary conditions "xxx ? yyy : false"Noel Grandin
Look for code like: xxx ? yyy : false; Which can be simplified to: xxx && yyy Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
2014-02-28sal_Bool -> bool in mostly vcl moduleChris Sherlock
Conflicts: include/vcl/settings.hxx svtools/source/table/tablecontrol_impl.cxx sw/source/core/frmedt/fecopy.cxx vcl/inc/canvasbitmap.hxx vcl/inc/headless/svpframe.hxx vcl/inc/unx/salframe.h vcl/inc/win/salframe.h vcl/inc/win/salprn.h vcl/inc/win/salvd.h vcl/osx/DragSource.cxx vcl/osx/DragSource.hxx vcl/osx/DropTarget.cxx vcl/osx/DropTarget.hxx vcl/osx/OSXTransferable.cxx vcl/osx/OSXTransferable.hxx vcl/osx/clipboard.cxx vcl/osx/clipboard.hxx vcl/osx/salprn.cxx vcl/qa/cppunit/canvasbitmaptest.cxx vcl/source/components/fontident.cxx vcl/source/control/edit.cxx vcl/source/control/spinfld.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/virdev.cxx vcl/source/helper/canvasbitmap.cxx vcl/source/window/dockwin.cxx vcl/unx/generic/dtrans/X11_selection.hxx vcl/unx/kde/UnxFilePicker.cxx vcl/unx/kde/UnxFilePicker.hxx vcl/unx/kde4/KDE4FilePicker.cxx vcl/unx/kde4/KDE4FilePicker.hxx vcl/unx/kde4/KDESalFrame.hxx Change-Id: I9866d985da86dea2a56feff23f91c1467a1636b0 Reviewed-on: https://gerrit.libreoffice.org/8219 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-21vcl: sal_Bool -> boolStephan Bergmann
Change-Id: I2a3e3d3e3266ea0f0fafdd91362076a4aa160f0e
2013-12-04oox: render progress bar in main thread for threaded import.Michael Meeks
Experimental only. This avoids ,us deadlocking as the main thread tries to join it's children, and the child threads wait to 'Yield' in the progress bar update. Also it's generally safer to move progress reporting out of the other threads, and to have the mainloop spinning here. Finally this allows people to continue to use the LibreOffice suite while large XLSX spreadsheets are loading. Change-Id: Id41c18f3941d6fc5eea593f7cfcf6a8b7215b3f8
2013-11-20sal_Bool to bool in VCL Timer and minor cleanupsRodolfo Ribeiro Gomes
Change-Id: I72e3987af4509239b2e989483b7396512c17e48b Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/6695 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-10-23fixincludeguards.sh: include/vclThomas Arnhold
Change-Id: Iaea4396f60aeade5303bf83a4504ad62f161b83c
2013-04-23execute move of global headersBjoern Michaelsen
see https://gerrit.libreoffice.org/#/c/3367/ and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a