Commit Graph

59 Commits

Author SHA1 Message Date
Jan-Marek Glogowski
7a1c1699a6 Run Idle tasks immediatly
There is really no reason to wait a millisecond for an idle.

Change-Id: I7665d5f2e7d6ba3e01290a692bbc8e42c36b9986
2017-07-13 12:10:23 +02:00
Jan-Marek Glogowski
917be98e3f Round-robin invoked tasks
Add some round-robin to the task processing, so equal priority
(auto) tasks won't always be scheduled, if there are multiple
tasks with the same priority.

Change-Id: Ice111aa5f85e9181b3ee9799ca4df0d58f210fe9
2017-07-13 12:10:23 +02:00
Jan-Marek Glogowski
23beae53b4 Correctly account invoked task
Don't account the to-be invoked task before invoking it.
If it happens to be restarted, account it and eventually lower
the system timer timeout.

Change-Id: I567e3b92c6c2999ce51aecb31f858e51cab6c999
2017-07-13 12:10:22 +02:00
Jan-Marek Glogowski
b22526b8ad Introduce a scheduler stack
While the stack removes all invoked tasks from the queue, which
actively removes it from scheduling, it also helps to faster handle
nested calls, as we don't have to look for the previous position
to move the task to the end of the queue for the round robin.

Change-Id: I358cf2492e9630f67685a2b780509edb56691830
2017-07-13 12:10:22 +02:00
Jan-Marek Glogowski
d93acb7766 Correctly account starting tasks
When (re-)starting the system timer for new task, we have to take
the already passed time into account to correctly set the new
timeout time for the system timer.

Change-Id: I1c1c61b3e54bd14d9451c53150251534b2a960f0
2017-07-13 12:10:22 +02:00
Jan-Marek Glogowski
d348035a60 Drop special idle handling
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-13 12:10:21 +02:00
Jan-Marek Glogowski
1782893282 Change scheduler list to be queue-like
The scheduler modifies the SchedulerData list mainly in two ways:
 1. Remove a finished item
 2. Append a new item

This optimizes the Append operation by keeping a last element
pointer, so we don't have to walk the whole list to find it. This
way this list is converted to a queue-like structure.

Change-Id: If7214e1f6016414551abbef11f26f332737f7893
2017-07-13 12:10:21 +02:00
Jan-Marek Glogowski
eb2035fe20 Refactor Scheduler by merging functions
Merges ImplSchedulerData::Invoke() into ProcessTaskScheduling()
and removes indention levels in CalculateMinimumTimeout by using
goto. This is straight forward.

Change-Id: I740b97315df92f8b979089e7e22058e628f95bc0
2017-07-13 12:10:20 +02:00
Jan-Marek Glogowski
b9ae1505e3 Move scheduler task into its own header
Change-Id: I54534787b8cfa4c47dc09dde9c38a7893df9d367
2017-07-13 12:10:20 +02:00
Jan-Marek Glogowski
d72aad218c Refactor Scheduler global data
Move all Scheduler members of ImplSVData into ImplSchedulerContext
and make ImplSchedulerContext a member of ImplSVData.

Change-Id: I186bebdfb5701543595848968235b5a56b6598e9
2017-07-13 12:10:20 +02:00
Jan-Marek Glogowski
c0710abfeb Add some Scheduler unit tests and logging
1. calling Start() for invoked tasks
 2. correctly schedule by priority
 3. self-stopping AutoTimer

This also adds SAL_INFO output to Scheduler and Task to log the
scheduling processing tasks.

Change-Id: I3c8a708d1fd51c550320f8af3f9486c43c32e358
2017-07-13 12:10:20 +02:00
László Németh
08f6f9dded Profiling API: add ProfileZones
Change-Id: Ie5669bd75d9b4be047d98402cb69ac313ab618df
Reviewed-on: https://gerrit.libreoffice.org/38787
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-06-16 14:01:56 +02:00
Caolán McNamara
d0069e5189 add COVERITY_NOEXCEPT_FALSE
to markup dtors that coverity warns might throw exceptions
which won't throw in practice, or where std::terminate is
an acceptable response if they do

Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4
Reviewed-on: https://gerrit.libreoffice.org/38318
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06 14:15:43 +02:00
Andrea Gelmini
3c3f7d784e Removed duplicated includes
No automatic tools. Manual checked and tested.

Change-Id: Ife260fa4e1d786cf81f2917a901664cc54943754
Reviewed-on: https://gerrit.libreoffice.org/36371
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-13 07:46:16 +02:00
Jan-Marek Glogowski
7cf3ae68af Apply stricter member access control for Tasks
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-20 10:32:04 +00:00
Jan-Marek Glogowski
fdc612619c Refactor Scheduler to add Task class
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-17 16:08:47 +01:00
Jan-Marek Glogowski
17bb382624 Convert bTimer => bIdle
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-17 16:08:47 +01:00
Jan-Marek Glogowski
9ec3b1e1bf Always schedule with the same time
No need to always update the time - scheduling should be fast!

Change-Id: Ic4c01f5a5759ef4970f1385aab6ef93cd67f33b6
2017-01-17 16:08:46 +01:00
Noel Grandin
19a4eaab9a tdf#100337 Message boxes showup empty with white background
the bug here was that we had, on the stack, going into the scheduler
THREE times. Two of those were idles.

The original code would end up always picking the first idle from inside
    ImplSchedulerData::GetMostImportantTask
and then
    ImplSchedulerData::Invoke
would just return because we were still inside that Idle, and the second
Idle would never get executed

Since the second Idle was responsible for painting the dialog in the
bug, sometimes the dialog would never get painted.

Change-Id: Ia15b98a06e231c8e1c29450e05a76ad427e41e36
Reviewed-on: https://gerrit.libreoffice.org/31785
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
2016-12-09 13:39:27 +00:00
Noel Grandin
0ed936cc74 pretty the scheduler debug a little
Change-Id: Ia5fe9869b5730a81d4343c4fe0a6cf7ca942cca6
2016-12-06 13:42:32 +02:00
Stephan Bergmann
8b30c5228b Rewrite some (trivial) assignments inside if/while conditions: vcl
Change-Id: I26fd9bf9838b0d9d6cf35dc62195216a0c1333ee
2016-11-29 17:17:32 +01:00
Michael Meeks
c00d8271ba vcl: assert solar mutex is held for various timer / scheduler ops.
Bringing paranoia to some source-code near you.

Change-Id: I92bc1e17480405a6388c2cbd1c7b559728539f67
Reviewed-on: https://gerrit.libreoffice.org/30024
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-10-19 10:58:13 +00:00
Jan Holesovsky
3f98cf3283 tdf#100092: Deterministic scheduling to prevent unpredictable behavior.
Low priority idles can fire more or less randomly, and consequently two
consequent runs of LibreOffice differ in the amount of the idles that have
been performed during an operation.

This commit adds a possibility to turn on a 'deterministic mode' where two
subsequent runs of LibreOffice trigger about the same amount of events when
they perform the same set of operations.

Change-Id: I92566ef4eee20e7d604cfd48f01c4df30c77e653
2016-05-31 15:23:59 +02:00
Michael Meeks
7ccdb94e2c vcl: scheduler - remove obsolete comment.
Change-Id: I8a469f73b682e32bbb15a71e5be9b64d8412f3f1
2016-03-03 02:40:17 +00:00
Michael Meeks
b952aaacb1 Ensure processEventsToIdle process events (including from the OS) until idle.
Change-Id: I9578849b0e78af15ddeb1e6495a48ccfb3f1c44a
Reviewed-on: https://gerrit.libreoffice.org/22651
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-02-24 09:40:02 +00:00
Tor Lillqvist
7b6fd31c65 No need to name unused parameters
Change-Id: I982a67f1e5279aa18131f99f4a8ba5c5c2c005a7
2016-01-12 11:03:11 +02:00
Chris Sherlock
c89f9b19ce vcl: silence doxygen warning
Change-Id: I132672582136abfcec0eeafd2400757def824dbf
2016-01-08 14:04:16 +11:00
Tor Lillqvist
0cdf09089d Make ImplSVData private to vcl
Change-Id: I1df6ba8a269be3e165ff5948af1dd12e0bdc6f7d
2015-12-08 15:57:36 +02:00
Michael Meeks
fbdeef6b7f vcl: fix event processing to idle - for JUnit tests.
Change-Id: Ibeb1f6627815fc34c6e166357c88e076b75f6abb
Reviewed-on: https://gerrit.libreoffice.org/20197
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-26 12:03:32 +00:00
Noel Grandin
ce5024ad52 loplugin:redundantcast
Change-Id: I3fd7b6f8215bdd9e482cc81522a70cabc0080c4f
2015-11-26 09:26:13 +02:00
Michael Meeks
766524b13b vcl: further fix debug name cleanup.
Change-Id: Ia95c4893773bec77fe2ddf1a85e8687ab6776e10
2015-11-25 23:38:49 +00:00
Michael Meeks
87d41e3b7d vcl: cleanup scheduler debug name usage.
Change-Id: I94975d220452ca91cbbd9db5e7895fa0b3a88e4a
2015-11-25 23:33:21 +00:00
Michael Meeks
10a451e979 vcl: don't treat non-ready timers as idle handlers.
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-25 23:22:06 +00:00
Michael Meeks
9c554c2c8c vcl: improve scheduler debugging information.
Change-Id: I6f7d7d3b5b027097417a15804a42aaaab4a03158
Reviewed-on: https://gerrit.libreoffice.org/20185
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-25 23:15:42 +00:00
Michael Meeks
87199d3829 vcl: re-introduce idle handling.
The idea here is that we should process 'idle' events - like re-paint
after we have processed any OS messages - such as key/mouse input,
window re-size events etc.

The previous approach wasn't achieving this - it was processing a single
idle event each time around the main-loop iteration; urk.

Lubos implemented something -like- this, the vestiges of it need cleaning
up and removing in: 06d731428e but it was
disabled (most likely because it broke gtk in tdf#91727, which was itself
broken by using silly values for timeouts in the scheduler (now fixed))

Tested on Windows, gtk, kde4, unx-generic.

Change-Id: I7756bca874779c00f72b372cacb7745d0f189f66
Reviewed-on: https://gerrit.libreoffice.org/20158
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-24 19:46:02 +00:00
Michael Meeks
d3cdd7efca vcl: scheduler - split timeout calculation from idle invocation.
This moves us towards unifying timeouts, events, idle handlers leaving
only the OS main-loop integration in the backends.

Change-Id: Iebfb0db21777d8018b33f216b13acb4ea2068659
2015-11-24 12:57:22 +00:00
Michael Meeks
5a08d3fa47 vcl: remove UpdateStack concept.
Change-Id: I6d9b7de7c57349bfb9c75a35e63bcf1eac172fd2
Reviewed-on: https://gerrit.libreoffice.org/20143
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-24 12:40:29 +00:00
Michael Meeks
4bd8ffd27f Replace return boolean from DoYield with pleasant enumeration.
Change-Id: I1b1f885b4d7916a18dfb2457a8e9af9a5b4ae6e4
Reviewed-on: https://gerrit.libreoffice.org/20138
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-11-24 09:02:31 +00:00
Michael Stahl
f324e507ac vcl: avoid re-starting the WNT TimerQueue during shutdown
When running CppunitTest_sc_macros_test in DrMemory, numerous
unaddressable accesses from SalTimerProc are reported.

During DeInitVCL(), ImplSalStopTimer() shuts down the TimerQueue, but
then the problem is that some disposing of some sidebar related UNO
service ends up calling Window::dispose() and Window::Hide() and
Window::ImplPostPaint(), which starts an Idle job maPaintIdle
that then re-starts the Win32 TimerQueue.

Change-Id: Ie1ab14330b6f1002c12d5302bb19f2b3f4c3811d
2015-11-17 23:49:04 +01:00
Stephan Bergmann
d3b6cb7ec2 loplugin:nullptr (automatic rewrite)
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-11-10 10:32:00 +01:00
Miklos Vajna
3dfeae78ca vcl: restore lost hunk in Scheduler::ImplStartTimer()
Regression from commit 6d64d2f38d (Minor
refactoring and cleanup of Scheduler and Timer., 2015-07-19), the old
Timer::ImplStartTimer() used to set nMS to at least 1, but the new
Scheduler::ImplStartTimer() didn't do that.

With this, JunitTest_sw_unoapi_3 no longer hangs for me.

Change-Id: I16ad360f1e5430cde7ec8b28e8c2620d260c9ec0
2015-09-09 12:30:57 +02:00
Michael Meeks
5bac7853a8 Ensure the scheduler can set longer timeouts.
Regression from: 6d64d2f38d.

Also fix the low priority idle min timeout to 5ms.

Change-Id: I26a6e89ef7fa173e64ee34f7a500157ba82b7198
2015-09-08 17:01:31 +01:00
Ashod Nakashian
6d64d2f38d Minor refactoring and cleanup of Scheduler and Timer.
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-09-04 18:43:41 +00:00
Ashod Nakashian
032e251f0f tdf#92036 - Writer infinite spelling loop
The periodic timers fire when the current time exceeds the
start time + the period. However, without reseting the start
time, the timer would end up thinking it must fire immediatly.

By reseting the start time when firing, the timer will
only fire again when another period has expired, not immediatly.

Change-Id: Ibd0311b12a514bfd558c0bd6ef83df8c89fd8c7e
Reviewed-on: https://gerrit.libreoffice.org/17194
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-18 19:43:50 +00:00
Stephan Bergmann
09c5a9d41e Revert "std::list for Scheduler"
This reverts commit 1289d3c42a, plus follow-ups
762e90ffa0 "vcl: loplugin:pointertobool" and
863e5685dd "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::uno::Reference<com::sun::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::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:191)
>  non-virtual thunk to WriterFilter::filter(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:126)
>  SfxObjectShell::ImportFrom(SfxMedium&, com::sun::uno::Reference<com::sun::text::XTextRange> const&) (/sfx2/source/doc/objstor.cxx:2271)
>  SfxObjectShell::DoLoad(SfxMedium*) (/sfx2/source/doc/objstor.cxx:767)
>  SfxBaseModel::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1859)
>  non-virtual thunk to SfxBaseModel::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1810)
>  (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:703)
>  non-virtual thunk to (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::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::uno::Reference<com::sun::frame::XComponentLoader> const&, com::sun::uno::Reference<com::sun::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/framework/source/loadenv/loadenv.cxx:164)
>  framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/framework/source/services/desktop.cxx:566)
>  non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/framework/source/services/desktop.cxx:552)
>  unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘: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::uno::Reference<com::sun::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::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:191)
>  non-virtual thunk to WriterFilter::filter(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/writerfilter/source/filter/WriterFilter.cxx:126)
>  SfxObjectShell::ImportFrom(SfxMedium&, com::sun::uno::Reference<com::sun::text::XTextRange> const&) (/sfx2/source/doc/objstor.cxx:2271)
>  SfxObjectShell::DoLoad(SfxMedium*) (/sfx2/source/doc/objstor.cxx:767)
>  SfxBaseModel::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1859)
>  non-virtual thunk to SfxBaseModel::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/sfx2/source/doc/sfxbasemodel.cxx:1810)
>  (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:703)
>  non-virtual thunk to (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&, com::sun::uno::Reference<com::sun::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::uno::Reference<com::sun::frame::XComponentLoader> const&, com::sun::uno::Reference<com::sun::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/framework/source/loadenv/loadenv.cxx:164)
>  framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/framework/source/services/desktop.cxx:566)
>  non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::uno::Sequence<com::sun:🫘:PropertyValue> const&) (/framework/source/services/desktop.cxx:552)
>  unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::uno::Sequence<com::sun:🫘: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-15 17:35:33 +02:00
Thorsten Behrens
863e5685dd Fix funny line-ends.
Change-Id: I693d78854544b3f3bb441b17b0a062c738cda039
2015-06-13 10:20:53 +02:00
Miklos Vajna
762e90ffa0 vcl: loplugin:pointertobool
Change-Id: I0a84cce306d92c9358ae7a2a4d76f455e44f312b
2015-06-12 22:14:00 +02:00
Juergen Funk
1289d3c42a std::list for Scheduler
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 2e29a518b0 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-12 15:19:20 +00:00
Michael Meeks
48c2815dd2 tdf#91727 - Unwind non-dispatch of idle handlers.
This clobbers the functionality from commit:

    06d731428e

    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-06-10 17:27:20 +01:00
Tobias Madl
b6044f7640 Scheduler: Deactivate task without deletion
Now a task can be temporary deactivatet, without deletion.

Change-Id: Ie72f0fe0e1529e2216271a3ae73be1c406947dec
Reviewed-on: https://gerrit.libreoffice.org/15640
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-05-14 13:28:25 +00:00