summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-10-18 21:38:34 +0100
committerMichael Meeks <michael.meeks@collabora.com>2016-10-19 10:58:13 +0000
commitc00d8271ba443c4f0acf657c226eea4824597f95 (patch)
tree0ab627c6ff2161812d9f07de157ecf9596509c59
parent0f5d4da2b41fb30aea5465465052f4438ba3ba8c (diff)
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>
-rw-r--r--vcl/source/app/scheduler.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 4dcbc4d196b6..4caa4d27e82e 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -31,6 +31,8 @@ void InitSystemTimer(ImplSVData* pSVData);
void ImplSchedulerData::Invoke()
{
+ DBG_TESTSOLARMUTEX();
+
if (mbDelete || mbInScheduler )
return;
@@ -127,6 +129,9 @@ void Scheduler::ImplStartTimer(sal_uInt64 nMS, bool bForce)
// ImplSalStopTimer() on WNT the timer queue is restarted and never ends
return;
}
+
+ DBG_TESTSOLARMUTEX();
+
InitSystemTimer(pSVData);
if ( !nMS )
@@ -169,6 +174,8 @@ bool Scheduler::ProcessTaskScheduling( bool bTimerOnly )
{
ImplSchedulerData* pSchedulerData;
+ DBG_TESTSOLARMUTEX();
+
if ((pSchedulerData = ImplSchedulerData::GetMostImportantTask(bTimerOnly)))
{
SAL_INFO("vcl.schedule", "Invoke task " << pSchedulerData->GetDebugName());
@@ -203,6 +210,8 @@ sal_uInt64 Scheduler::CalculateMinimumTimeout( bool &bHasActiveIdles )
sal_uInt64 nTime = tools::Time::GetSystemTicks();
sal_uInt64 nMinPeriod = MaximumTimeoutMs;
+ DBG_TESTSOLARMUTEX();
+
SAL_INFO("vcl.schedule", "Calculating minimum timeout:");
pSchedulerData = pSVData->mpFirstSchedulerData;
while ( pSchedulerData )
@@ -275,6 +284,8 @@ void Scheduler::Start()
return;
}
+ DBG_TESTSOLARMUTEX();
+
// Mark timer active
mbActive = true;