diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-03-18 19:21:50 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2017-03-18 11:01:24 +0000 |
commit | c154f9a0827dcc2fc69870198d368fa8ebb4cde2 (patch) | |
tree | 30a967a8ae083a5349577982b6f1eb6a79913504 /vcl/source/opengl | |
parent | 5198b4b8c7a7086753e499900b227e16f3d65340 (diff) |
vcl: change opengl gpWatchdogExt from oslCondition to osl::Condition
Condition is deprecated already, but there is no need for the
us to use the low-level C-API, when in fact there is a C++ fascade
that calls on this via the C++ abstraction, osl::Condition.
This will make it much easier to switch to using std::condition_variable
in the future.
Change-Id: I0d7fda22ad00a79767b68cd06f00decfc0555371
Reviewed-on: https://gerrit.libreoffice.org/35390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 1969f016b4e0..f04d80f38e65 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -36,7 +36,7 @@ #include "salinst.hxx" #include "opengl/zone.hxx" #include "opengl/watchdog.hxx" -#include <osl/conditn.h> +#include <osl/conditn.hxx> #include <vcl/opengl/OpenGLWrapper.hxx> #include <vcl/opengl/OpenGLContext.hxx> #include <desktop/crashreport.hxx> @@ -812,7 +812,7 @@ void OpenGLZone::leave() { gnLeaveCount++; } namespace { static volatile bool gbWatchdogFiring = false; - static oslCondition gpWatchdogExit = nullptr; + static osl::Condition* gpWatchdogExit = nullptr; static WatchdogTimings gWatchdogTimings; static rtl::Reference<OpenGLWatchdogThread> gxWatchdog; } @@ -840,7 +840,7 @@ void OpenGLWatchdogThread::execute() do { sal_uInt64 nLastEnters = OpenGLZone::gnEnterCount; - osl_waitCondition(gpWatchdogExit, &aQuarterSecond); + gpWatchdogExit->wait(&aQuarterSecond); if (OpenGLZone::isInZone()) { @@ -897,13 +897,13 @@ void OpenGLWatchdogThread::execute() { nUnchanged = 0; } - } while (!osl_checkCondition(gpWatchdogExit)); + } while (!gpWatchdogExit->check()); } void OpenGLWatchdogThread::start() { assert (gxWatchdog == nullptr); - gpWatchdogExit = osl_createCondition(); + gpWatchdogExit = new osl::Condition(); gxWatchdog.set(new OpenGLWatchdogThread()); gxWatchdog->launch(); } @@ -914,7 +914,7 @@ void OpenGLWatchdogThread::stop() return; // in watchdog thread if (gpWatchdogExit) - osl_setCondition(gpWatchdogExit); + gpWatchdogExit->set(); if (gxWatchdog.is()) { @@ -923,7 +923,7 @@ void OpenGLWatchdogThread::stop() } if (gpWatchdogExit) - osl_destroyCondition(gpWatchdogExit); + delete gpWatchdogExit; gpWatchdogExit = nullptr; } |