summaryrefslogtreecommitdiff
path: root/include/vcl/scheduler.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-07-27 11:42:31 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-08-04 13:38:20 +0200
commitd55aabfd44563027aceffd0020f55b166184a0ca (patch)
tree9073855842a11796e8ea8434896eedd7b7b10747 /include/vcl/scheduler.hxx
parent3dd30f7ec568852ffd95932b486d0a09a2021d71 (diff)
Implement VCL Scheduler locking
Replces the SolarMutex scheduler locking by using a distinct mutex included in the scheduler context. It should also get rid of the spurious assert( !bAniIdle ) failures, as the test now holds the Scheduler lock for the whole time. This includes reverting the additional scheduler de-init from commit 2e29a518b04250b5f9cc9d0d77da3df076834d60, as I couldn't reproduce the bug running the unit test in valgrind. Change-Id: If33f815fe86c8f82175e96adceb1084b925319dd Reviewed-on: https://gerrit.libreoffice.org/40497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include/vcl/scheduler.hxx')
-rw-r--r--include/vcl/scheduler.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 370c367be04f..1196466cdb22 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -22,6 +22,7 @@
#include <vcl/dllapi.h>
+class SchedulerGuard;
class Task;
struct TaskImpl;
struct ImplSchedulerContext;
@@ -29,8 +30,9 @@ struct ImplSchedulerData;
class VCL_DLLPUBLIC Scheduler final
{
+ friend class SchedulerGuard;
friend class Task;
- Scheduler() = delete;
+ Scheduler() SAL_DELETED_FUNCTION;
static inline void UpdateSystemTimer( ImplSchedulerContext &rSchedCtx,
sal_uInt64 nMinPeriod,
@@ -38,6 +40,9 @@ class VCL_DLLPUBLIC Scheduler final
static void ImplStartTimer ( sal_uInt64 nMS, bool bForce, sal_uInt64 nTime );
+ static bool 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;