Kaydet (Commit) 61ac80a6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

ENABLE_MUTEXDEBUG is never defined

Change-Id: I533cc7041177cceff14d1e44e4cd1d25d5e94c11
üst 11fd73ac
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
#undef ENABLE_WARNINGS #undef ENABLE_WARNINGS
#undef ENABLE_EVENTDEBUG #undef ENABLE_EVENTDEBUG
#undef ENABLE_REGISTRATIONDEBUG #undef ENABLE_REGISTRATIONDEBUG
#undef ENABLE_MUTEXDEBUG
// #undef ENABLE_TIMEMEASURE // #undef ENABLE_TIMEMEASURE
#undef ENABLE_MEMORYMEASURE #undef ENABLE_MEMORYMEASURE
#undef ENABLE_FILTERDBG #undef ENABLE_FILTERDBG
...@@ -98,11 +97,6 @@ ...@@ -98,11 +97,6 @@
//***************************************************************************************************************** //*****************************************************************************************************************
#include <macros/debug/registration.hxx> #include <macros/debug/registration.hxx>
//*****************************************************************************************************************
// special macros to debug threading mechanism
//*****************************************************************************************************************
#include <macros/debug/mutex.hxx>
//***************************************************************************************************************** //*****************************************************************************************************************
// special macros to debug our filter cache! // special macros to debug our filter cache!
//***************************************************************************************************************** //*****************************************************************************************************************
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __FRAMEWORK_MACROS_DEBUG_MUTEX_HXX_
#define __FRAMEWORK_MACROS_DEBUG_MUTEX_HXX_
//*****************************************************************************************************************
// special macros for mutex handling
//*****************************************************************************************************************
#ifdef ENABLE_MUTEXDEBUG
#include <rtl/strbuf.hxx>
/*_____________________________________________________________________________________________________________
LOGFILE_MUTEX
For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
_____________________________________________________________________________________________________________*/
#ifndef LOGFILE_MUTEX
#define LOGFILE_MUTEX "mutex.log"
#endif
/*_____________________________________________________________________________________________________________
LOG_LOCKTYPE( _EFALLBACK, _ECURRENT )
Write information about current set lock type for whole framework project to special file.
_____________________________________________________________________________________________________________*/
#define LOG_LOCKTYPE( _EFALLBACK, _ECURRENT ) \
/* new scope to prevent us against multiple definitions of variables ... */ \
{ \
OStringBuffer _sBuffer( 256 ); \
_sBuffer.append( "Set framework lock type to fallback: \"" ); \
switch( _EFALLBACK ) \
{ \
case E_NOTHING : _sBuffer.append( "E_NOTHING" ); \
break; \
case E_OWNMUTEX : _sBuffer.append( "E_OWNMUTEX" ); \
break; \
case E_SOLARMUTEX : _sBuffer.append( "E_SOLARMUTEX" ); \
break; \
case E_FAIRRWLOCK : _sBuffer.append( "E_FAIRRWLOCK" ); \
break; \
} \
_sBuffer.append( "\"\n" ); \
if( _EFALLBACK != _ECURRENT ) \
{ \
_sBuffer.append( "... environment overwrite framework lock type with: \"" ); \
switch( _ECURRENT ) \
{ \
case E_NOTHING : _sBuffer.append( "E_NOTHING" ); \
break; \
case E_OWNMUTEX : _sBuffer.append( "E_OWNMUTEX" ); \
break; \
case E_SOLARMUTEX : _sBuffer.append( "E_SOLARMUTEX" ); \
break; \
case E_FAIRRWLOCK : _sBuffer.append( "E_FAIRRWLOCK" ); \
break; \
} \
_sBuffer.append( "\"\n" ); \
} \
else \
{ \
_sBuffer.append( "... use fallback, because user don't set another value!\n" ); \
} \
WRITE_LOGFILE( LOGFILE_MUTEX, _sBuffer.makeStringAndClear() ) \
}
#else // #ifdef ENABLE_MUTEXDEBUG
/*_____________________________________________________________________________________________________________
If right testmode is'nt set - implements these macro with normal functionality!
We need the guard but not the log mechanism.
_____________________________________________________________________________________________________________*/
#undef LOGFILE_MUTEX
#define LOG_LOCKTYPE( _EFALLBACK, _ECURRENT )
#endif // #ifdef ENABLE_MUTEXDEBUG
#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_MUTEX_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -163,11 +163,6 @@ class FairRWLock : public IRWLock ...@@ -163,11 +163,6 @@ class FairRWLock : public IRWLock
// Used condition will open by last gone reader object. // Used condition will open by last gone reader object.
m_aSerializer.acquire(); m_aSerializer.acquire();
m_aWriteCondition.wait(); m_aWriteCondition.wait();
#ifdef ENABLE_MUTEXDEBUG
// A writer is an exclusiv accessor!
LOG_ASSERT2( m_nReadCount!=0, "FairRWLock::acquireWriteAccess()", "No threadsafe code detected ... : Read count != 0!" )
#endif
} }
/*-****************************************************************************************************//** /*-****************************************************************************************************//**
...@@ -189,11 +184,6 @@ class FairRWLock : public IRWLock ...@@ -189,11 +184,6 @@ class FairRWLock : public IRWLock
// by these mutex! // by these mutex!
// You don't need any other mutex here - you are the only one in the moment! // You don't need any other mutex here - you are the only one in the moment!
#ifdef ENABLE_MUTEXDEBUG
// A writer is an exclusiv accessor!
LOG_ASSERT2( m_nReadCount!=0, "FairRWLock::releaseWriteAccess()", "No threadsafe code detected ... : Read count != 0!" )
#endif
m_aSerializer.release(); m_aSerializer.release();
} }
...@@ -221,11 +211,6 @@ class FairRWLock : public IRWLock ...@@ -221,11 +211,6 @@ class FairRWLock : public IRWLock
// We can't check it - but otherwise it's your problem ... // We can't check it - but otherwise it's your problem ...
// Thats why you don't need any mutex here. // Thats why you don't need any mutex here.
#ifdef ENABLE_MUTEXDEBUG
// A writer is an exclusiv accessor!
LOG_ASSERT2( m_nReadCount!=0, "FairRWLock::downgradeWriteAccess()", "No threadsafe code detected ... : Read count != 0!" )
#endif
// Register himself as "new" reader. // Register himself as "new" reader.
// This value must be 0 before - because we support single writer access only! // This value must be 0 before - because we support single writer access only!
++m_nReadCount; ++m_nReadCount;
......
...@@ -506,8 +506,6 @@ ELockType& LockHelper::implts_getLockType() ...@@ -506,8 +506,6 @@ ELockType& LockHelper::implts_getLockType()
eType = (ELockType)(sValue.toInt32()); eType = (ELockType)(sValue.toInt32());
} }
LOG_LOCKTYPE( FALLBACK_LOCKTYPE, eType )
pType = &eType; pType = &eType;
} }
} }
......
...@@ -200,10 +200,6 @@ void TransactionManager::registerTransaction( EExceptionMode eMode, ERejectReas ...@@ -200,10 +200,6 @@ void TransactionManager::registerTransaction( EExceptionMode eMode, ERejectReas
// Safe access to internal member. // Safe access to internal member.
::osl::MutexGuard aAccessGuard( m_aAccessLock ); ::osl::MutexGuard aAccessGuard( m_aAccessLock );
#ifdef ENABLE_MUTEXDEBUG
LOG_ASSERT2( m_nTransactionCount<0, "TransactionManager::acquire()", "Wrong ref count detected!" )
#endif
// Register this new transaction. // Register this new transaction.
// If it is the first one .. close gate to disable changing of working mode. // If it is the first one .. close gate to disable changing of working mode.
++m_nTransactionCount; ++m_nTransactionCount;
...@@ -231,10 +227,6 @@ void TransactionManager::unregisterTransaction() throw( css::uno::RuntimeExcept ...@@ -231,10 +227,6 @@ void TransactionManager::unregisterTransaction() throw( css::uno::RuntimeExcept
// Safe access to internal member. // Safe access to internal member.
::osl::MutexGuard aAccessGuard( m_aAccessLock ); ::osl::MutexGuard aAccessGuard( m_aAccessLock );
#ifdef ENABLE_MUTEXDEBUG
LOG_ASSERT2( m_nTransactionCount<=0, "TransactionManager::release()", "Wrong ref count detected!" )
#endif
// Deregister this transaction. // Deregister this transaction.
// If it was the last one ... open gate to enable changing of working mode! // If it was the last one ... open gate to enable changing of working mode!
// (see setWorkingMode()) // (see setWorkingMode())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment