summaryrefslogtreecommitdiff
path: root/include/vcl/scheduler.hxx
blob: ac429ed33b09ca93abbb56fd4d74cd674b3f0d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_VCL_SCHEDULER_HXX
#define INCLUDED_VCL_SCHEDULER_HXX

#include <vcl/dllapi.h>

class SchedulerGuard;
class Task;
struct TaskImpl;
struct ImplSchedulerContext;
struct ImplSchedulerData;

class VCL_DLLPUBLIC Scheduler final
{
    friend class SchedulerGuard;
    friend class Task;
    Scheduler() SAL_DELETED_FUNCTION;

    static inline void UpdateSystemTimer( ImplSchedulerContext &rSchedCtx,
                                          sal_uInt64 nMinPeriod,
                                          bool bForce, sal_uInt64 nTime );

    static void ImplStartTimer ( sal_uInt64 nMS, bool bForce, sal_uInt64 nTime );

    static void Lock( sal_uInt32 nLockCount = 1 );
    static sal_uInt32 Unlock( bool bUnlockAll = false );

public:
    static constexpr sal_uInt64 ImmediateTimeoutMs = 0;
    static constexpr sal_uInt64 InfiniteTimeoutMs  = SAL_MAX_UINT64;

    static void       ImplDeInitScheduler();

    /// Process one pending Timer with highhest priority
    static void       CallbackTaskScheduling();
    /// Process one pending task ahead of time with highest priority.
    static bool       ProcessTaskScheduling();
    /**
     * Process all events until none is pending
     *
     * This can busy-lock, if some task or system event always generates new
     * events when being processed. Most time it's called in unit tests to
     * process all pending events. Internally it just calls
     * Application::Reschedule( true ) until it fails.
     *
     * @see Application::Reschedule
     */
    static void       ProcessEventsToIdle();

    /// Control the deterministic mode.  In this mode, two subsequent runs of
    /// LibreOffice fire about the same amount idles.
    static void       SetDeterministicMode(bool bDeterministic);
    /// Return the current state of deterministic mode.
    static bool       GetDeterministicMode();
};

#endif // INCLUDED_VCL_SCHEDULER_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-04-18 07:25:24 +0000'>2016-04-18clean-up: unused using declarations and includesJochen Nitschke Searched source for using declarations. Checked if those symbols reappear in the source file, even in comments or dead code but not in #include statements. If they don't reappear, remove the declaration. Remove includes whose symbol got removed. Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0 Reviewed-on: https://gerrit.libreoffice.org/24148 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> 2016-04-14loplugin:passstuffbyref in variousNoel Grandin Change-Id: I80070c83204e531c2f599f8a56193d6ffe0e5022 2016-04-13tdf#94306 remove unused boost dependenciesJochen Nitschke remove <boost/noncopyable.hpp> in pch and remove boost from makefile if it was the only boost entry. Change-Id: Icb945ae59c137571f4f63807601738eea5c3e831 Reviewed-on: https://gerrit.libreoffice.org/24061 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> 2016-04-12cleanup: remove unused com/sun/star/uno includesJochen Nitschke Sequence.h(xx), Any.h(xx) and Type.h(xx) and remove unused using-declarations from these files. Add a few missing includes provided by them. Change-Id: I6b91b6d1fdf9d0496dd546c0aab9bdcc6831a5d4 Reviewed-on: https://gerrit.libreoffice.org/23805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2016-04-04tdf#94306 replace boost::noncopyable in ..Jochen Nitschke .. accessibility, avmedia, basctl, basic and bridges remove boost from module if not needed anymore Change-Id: I6177f8276766a0a7df1703e81bf1b448912df6e2 Reviewed-on: https://gerrit.libreoffice.org/23744 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> 2016-04-04tdf#97499 Fixed containers parameters clearing #4tymyjan Change-Id: I7c96181399f4d7e62d4aceca404b22d68f903513 Reviewed-on: https://gerrit.libreoffice.org/23754 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2016-04-01tdf#97966 Drop 'static' keywordsWastack Including no keywords from extern "C" blocks Change-Id: Id0304994a692f1004993dda2ffd7fb819ab8e8d0 Reviewed-on: https://gerrit.libreoffice.org/23670 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com> 2016-03-31tdf#97525 vcl: make DeletionListener internalJochen Nitschke move include/vcl/impdel.hxx to vcl/inc/ include impdel.hxx in salframe.hxx remove vcl/impdel.hxx includes in pch add missing <list> includes Change-Id: Id146363b2e20ce0238542929c26a83efb1e8c4bd Reviewed-on: https://gerrit.libreoffice.org/23664 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2016-03-23loplugin:constantparam in accessiblityNoel Grandin Change-Id: I31c6a6b323d1d58c2304114652ca2881847a5b91 2016-03-18convert SvButtonState to scoped enumNoel Grandin Change-Id: I601f9e2fe33e85cf3f7dc52ee20d68202bd2b09d 2016-03-09loplugin:constantparam in accessibilityNoel Grandin Change-Id: I65f2f39c6bd5c222d7d8a21748ad02c521b7377d 2016-02-17use consistent #define checks for the Windows platformNoel Grandin stage 2 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro In this stage we focus on replacing usage of the WIN macro Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84 Reviewed-on: https://gerrit.libreoffice.org/22393 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2016-02-09Remove excess newlinesChris Sherlock A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> 2016-02-08vcl: cmdevt.[hc]xx -> commandevent.[hc]xxChris Sherlock Change-Id: I77b30f28ae5a6fad360d7cada9acfaa9c324408b Reviewed-on: https://gerrit.libreoffice.org/22216 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com> 2016-02-05solenv: fix mkdocs.sh to take into account projects with no inc dirChris Sherlock Change-Id: I959279c11f0ae5f372936ee3db605716cab37c21 2016-02-04accessibility: fix rest of doxygen errorsChris Sherlock I've changed the doxygen generation script to generate an xhtml page, and it uses SVG diagrams now. Change-Id: I876795675ae9ebcfec6f7fe5edc43c9d2e4964d3 2016-02-04accessibility: cleanup doxygen errorsChris Sherlock Change-Id: I6abc6e84edc461e8fa20f9c9689e0a66e26980af 2016-02-04accessibility: fix doxygen errorsChris Sherlock Change-Id: Ib1bed3e4df91ad00ecf2deb5c3d135cc2f5561b5 2016-02-04vcl: take into account the font width is the average font widthChris Sherlock I'm changing the Font class function names: - SetSize -> SetFontSize - GetSize -> GetFontSize - SetHeight -> SetFontHeight - GetHeight -> GetFontHeight - SetWidth -> SetAverageFontWidth - GetWidth -> GetAverageFontWidth That's because it really makes no sense to say that there is a single constant font width because obviously proportional fonts don't have one - the best we can do is an average font width, which is what folks like Microsoft sort of do already. On a fixed font, the average is still accurate, for obvious reasons :-) I'm also not a fan of GetSize/SetSize as I find it a might too generic. Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70 Reviewed-on: https://gerrit.libreoffice.org/22069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> 2016-02-02boost::hash->std::hashNoel Grandin Change-Id: If4d1e4071995f07212fad958b0226d5824d168f8 Reviewed-on: https://gerrit.libreoffice.org/21989 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> 2016-01-31tdf#88205 Delete 'css::uno::Sequence'kerem Change-Id: I23ecacb06f3c7c86a9a7f357d052175b7207aa2b Reviewed-on: https://gerrit.libreoffice.org/21916 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> 2016-01-31OSL_THIS_FUNC is a rip-off of BOOST_CURRENT_FUNCTION so we can use thatCaolán McNamara as a direct drop in I guess Change-Id: I3add63f1459f4e659019bd6db54da2f5431958ce Reviewed-on: https://gerrit.libreoffice.org/21941 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2016-01-27Unwind trivial AccessibleExtendedComponentHelper_BASE typedefsStephan Bergmann Change-Id: I74b30cba1359045873a3d7a3f0e72f857ffa0ed0 2016-01-21vcl: rename Font::GetFamily to Font::GetFamilyTypeChris Sherlock Change-Id: Ie427a43bd126dcdd89c6f66582736e67130f2254 Reviewed-on: https://gerrit.libreoffice.org/21633 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com> 2016-01-17vcl: rename Font::GetName to Font::GetFamilyNameChris Sherlock Change-Id: Ie20871a3078bf875c1782b7761d60591a9c9704f Reviewed-on: https://gerrit.libreoffice.org/21529 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> 2016-01-16revert vcl patch series that brok Mac and WindowsNorbert Thiebaud revert: 9bc2f3de8672e812f3a67541c6d7069b434a7e42 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight() 26371f105bc44e04469ec03fc5bb12505e651c6b vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic() 2dd0b4317372b8022efe3911b38b4fa02956d8b9 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual 5ab13bf3ead3539e4ad847656da81e7eb6029652 vcl: tabify font.hxx f99550dae55e40e49bf9c9875053fe2abb4c71ca vcl: change Font::SetName() to Font::SetFamilyName() 2b297116cb6bb1061c43e5714e2609c8ee9f57d2 vcl: rename Font::GetName to Font::GetFamilyName Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62 2016-01-16vcl: rename Font::GetName to Font::GetFamilyNameChris Sherlock Change-Id: I83927e0992dfe0a2a79d139818a9f45d3761aae5 Reviewed-on: https://gerrit.libreoffice.org/21509 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com> 2016-01-11loplugin:unusedmethods unused return value in accessibilityNoel Grandin Change-Id: Iee5a667a0fadfb04a2cc97d01f6febfd71c15e54 2016-01-10Fix typosAndrea Gelmini Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> 2016-01-05Fix typosAndrea Gelmini Change-Id: I3fba2c76c83381eb398c80947ef4849bccf7ab27 Reviewed-on: https://gerrit.libreoffice.org/21078 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> 2015-12-17Remove unused ToolPanel (aka TaskPane)Samuel Mehrbrodt Superseded by the Sidebar Change-Id: I54970d71cd9d42de4f47b223e50dd9474b40632a Reviewed-on: https://gerrit.libreoffice.org/20724 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> 2015-12-11No need for a separate <vcl/graph.h>Tor Lillqvist Change-Id: I962544005b5d408f7c044a02eefe09b87d8a81fe 2015-12-10loplugin:nullptr: More NULL -> nullptr automatic rewriteStephan Bergmann Change-Id: Ie83819e2bcdc5fa160b39296b005ca9a5ff74b1d 2015-12-03Use comphelper::containerToSequence()Noel Grandin Change-Id: I18d6ef04ff00f971a4c54ba259733c07501c6c1a 2015-11-25loplugin:unusedfields variousNoel Grandin Change-Id: I59d9f7f73677358b4ae57efda965d43718bdf0d5 2015-11-20add mapKeysToSequence/mapValuesToSequence methods to comphelperNoel Grandin and use them Change-Id: If4dc9df63db37185228aeaaab2979498d61304ec Reviewed-on: https://gerrit.libreoffice.org/20055 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> 2015-11-15Fast PCH generator and optimized PCH filesAshod Nakashian Ported update_pch.sh to Python with improved performance and features. The new script is invoked from the same update_pch.sh which calls it for each library in parallel, although it can be invoked directly. The ported script (update_pch) updates all PCH files in ~15 seconds where the old script took ~4500 seconds. In addition, the new script supports 3-tiered headers (system, module, and local) and is very flexible to support other improvement. It has a per-library optimal configuration settings that can be updated using another new scripts (update_pch_autotune.sh) which finds optimal per-PCH settings. PCH files have been generated using the new scripts which builds significantly faster (2-3x, depending on module and configuration) and the intermediate binaries are noticably smaller (by several GBs). The new script stamps each generated PCH file with the command that generated it to make it trivial for users to update them, and also adds the command to invoke another script (update_pch_bisect) that helps find missing headers or conflicting headers that may break the build after updating the PCH. Finally update_pch has built-in unit-tests for makefile parsing and other core functionality. Change-Id: Ib933b50e50374d7e2e7e3e95ba8799b0cc8a27fa Reviewed-on: https://gerrit.libreoffice.org/19965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> 2015-11-15use initialiser syntax for Sequence<OUString>Noel Grandin replaced using the script: git grep -lP 'Sequence.*OUString.*\(1\)' | xargs perl -0777 -pi -e "s/Sequence< OUString > (\w+)\(1\); .*\[0\] = (\S+);/Sequence< OUString > \1 { \2 };/g" Change-Id: I23688a91562051a8eed11fc2a85599545c285c34 Reviewed-on: https://gerrit.libreoffice.org/19967 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>