[Libreoffice-commits] core.git: vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Sat Mar 18 11:01:46 UTC 2017
vcl/source/opengl/OpenGLHelper.cxx | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit c154f9a0827dcc2fc69870198d368fa8ebb4cde2
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sat Mar 18 19:21:50 2017 +1100
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 at libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
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;
}
More information about the Libreoffice-commits
mailing list