diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-01-23 11:56:41 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-13 12:10:20 +0200 |
commit | c0710abfebd320903a3edb23d4b1441ea351b0be (patch) | |
tree | d0a02eceed8c830cfc7a1da2bc7d14d70c8a69aa /vcl/inc | |
parent | dc63cc326ee5757124cef45e470d290e6e32002e (diff) |
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
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/headless/svpinst.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/osx/salinst.h | 3 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/saltimer.hxx | 12 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 1 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 1 |
7 files changed, 18 insertions, 3 deletions
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx index 731642f5762c..4a82c413372a 100644 --- a/vcl/inc/headless/svpinst.hxx +++ b/vcl/inc/headless/svpinst.hxx @@ -157,6 +157,7 @@ public: // and timer virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; virtual bool AnyInput( VclInputFlags nType ) override; + virtual bool IsMainThread() const override { return true; } // may return NULL to disable session management virtual SalSession* CreateSalSession() override; diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index 6570ab32a7e2..b92a2aa35665 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -142,7 +142,8 @@ public: void PostUserEvent( AquaSalFrame* pFrame, SalEvent nType, void* pData ); void delayedSettingsChanged( bool bInvalidate ); - bool isNSAppThread() const; + // Is this the NSAppThread? + virtual bool IsMainThread() const override; void startedPrintJob() { mnActivePrintJobs++; } void endedPrintJob() { mnActivePrintJobs--; } diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index ca8017d94513..0e2703af8999 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -127,6 +127,7 @@ public: virtual void AcquireYieldMutex( sal_uLong nCount ) = 0; // return true, if yield mutex is owned by this thread, else false virtual bool CheckYieldMutex() = 0; + virtual bool IsMainThread() const = 0; /** * Wait for the next event (if bWait) and dispatch it, diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx index 234a18228af2..fcf450d28a7b 100644 --- a/vcl/inc/saltimer.hxx +++ b/vcl/inc/saltimer.hxx @@ -21,10 +21,9 @@ #define INCLUDED_VCL_INC_SALTIMER_HXX #include <sal/config.h> - #include <vcl/dllapi.h> - #include <salwtype.hxx> +#include <iostream> /* * note: there will be only a single instance of SalTimer @@ -72,6 +71,15 @@ struct ImplSchedulerData const char *GetDebugName() const; }; +template< typename charT, typename traits > +inline std::basic_ostream<charT, traits> & operator <<( + std::basic_ostream<charT, traits> & stream, const ImplSchedulerData& data ) +{ + stream << " i: " << data.mbInScheduler + << " d: " << data.mbDelete; + return stream; +} + #endif // INCLUDED_VCL_INC_SALTIMER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 250fd9b1ca1b..983fbf287deb 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -210,6 +210,8 @@ public: virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; virtual bool AnyInput( VclInputFlags nType ) override; + // impossible to handle correctly, as "main thread" depends on the dispatch mutex + virtual bool IsMainThread() const override { return false; } virtual GenPspGraphics *CreatePrintGraphics() override; diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index f3ca193df205..1f9c43bf2232 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -76,6 +76,7 @@ public: virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; virtual bool AnyInput( VclInputFlags nType ) override; + virtual bool IsMainThread() const override { return true; } virtual OUString GetConnectionIdentifier() override; void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; } diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index 25b4afb17aa0..022f67e0557a 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -62,6 +62,7 @@ public: virtual sal_uIntPtr ReleaseYieldMutex() override; virtual void AcquireYieldMutex( sal_uIntPtr nCount ) override; virtual bool CheckYieldMutex() override; + virtual bool IsMainThread() const override; virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; virtual bool AnyInput( VclInputFlags nType ) override; |