vcl/unx/generic/app/geninst.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
New commits: commit 2f048d891d2a3799e5d11bca90978849726a9ffb Author: Stephan Bergmann <[email protected]> Date: Thu Feb 11 17:31:14 2016 +0100 SalYieldMutex::acquire/release should always be called in pairs, no? Change-Id: Ia108d3d4db2a2f05d306da55a59520e9471bb336 diff --git a/vcl/unx/generic/app/geninst.cxx b/vcl/unx/generic/app/geninst.cxx index 77c6eae..99b992c 100644 --- a/vcl/unx/generic/app/geninst.cxx +++ b/vcl/unx/generic/app/geninst.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <cassert> #include <string.h> #include <stdlib.h> @@ -53,16 +56,14 @@ void SalYieldMutex::acquire() void SalYieldMutex::release() { - OSL_ENSURE(mnCount > 0, "SalYieldMutex::release() called with zero count"); - if ( mnThreadId == osl::Thread::getCurrentIdentifier() ) + assert(mnCount != 0); + assert(mnThreadId == osl::Thread::getCurrentIdentifier()); + if ( mnCount == 1 ) { - if ( mnCount == 1 ) - { - OpenGLContext::prepareForYield(); - mnThreadId = 0; - } - mnCount--; + OpenGLContext::prepareForYield(); + mnThreadId = 0; } + mnCount--; m_mutex.release(); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
