diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx index 24e0c6a30bcb..c19dd965755a 100644 --- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx +++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx @@ -30,16 +30,16 @@ #include #include #include -#include #include #include #include +#include // buffered VDev usage namespace { -class VDevBuffer : public Timer, protected cppu::BaseMutex +class VDevBuffer : public Timer { private: struct Entry @@ -53,6 +53,8 @@ private: } }; + std::mutex m_aMutex; + // available buffers std::vector maFreeBuffers; @@ -85,7 +87,7 @@ VDevBuffer::VDevBuffer() VDevBuffer::~VDevBuffer() { - ::osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); Stop(); while (!maFreeBuffers.empty()) @@ -132,7 +134,7 @@ bool VDevBuffer::isSizeSuitable(const VclPtr& device, const Size& VclPtr VDevBuffer::alloc(OutputDevice& rOutDev, const Size& rSizePixel, bool bTransparent) { - ::osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); VclPtr pRetval; sal_Int32 nBits = rOutDev.GetBitCount(); @@ -248,7 +250,7 @@ VclPtr VDevBuffer::alloc(OutputDevice& rOutDev, const Size& rSize void VDevBuffer::free(VirtualDevice& rDevice) { - ::osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); const auto aUsedFound = std::find_if(maUsedBuffers.begin(), maUsedBuffers.end(), [&rDevice](const Entry& el) { return el.buf == &rDevice; }); @@ -266,7 +268,7 @@ void VDevBuffer::free(VirtualDevice& rDevice) void VDevBuffer::Invoke() { - ::osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); while (!maFreeBuffers.empty()) {