Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

LOW_objectSynchronizerMacros.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           LOW_objectSynchronizerMacros.h  -  description
00003                              -------------------
00004     begin                : Sun Oct 19 2003
00005     copyright            : (C) 2003 by Harald Roelle
00006     email                : roelle@informatik.uni-muenchen.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019 //
00020 // uncomment the following preprocessor directive to get some debugging
00021 //
00022 #define DEBUG_LOCKING
00023 
00024 
00025  
00026 //
00027 // Shortcut macro for lock inside methods
00028 //
00029 
00030 #ifdef DEBUG_LOCKING
00031 
00032 #define __LOW_SYNCHRONIZE_METHOD_READ__        __synchronizeMethodRead      __methodSyncer = __synchronizeMethodRead( *this, __FILE__, __LINE__);
00033 #define __LOW_SYNCHRONIZE_METHOD_WRITE__       __synchronizeMethodWrite     __methodSyncer = __synchronizeMethodWrite( *this, __FILE__, __LINE__);
00034 #define __LOW_SYNCHRONIZE_METHOD_READ_WEAK__   __synchronizeMethodReadWeak  __methodSyncer = __synchronizeMethodReadWeak( *this, __FILE__, __LINE__);
00035 #define __LOW_SYNCHRONIZE_METHOD_WRITE_WEAK__  __synchronizeMethodWriteWeak __methodSyncer = __synchronizeMethodWriteWeak( *this, __FILE__, __LINE__);
00036 
00037 #else
00038 
00039 #define __LOW_SYNCHRONIZE_METHOD_READ__        __synchronizeMethodRead      __methodSyncer = __synchronizeMethodRead( *this);
00040 #define __LOW_SYNCHRONIZE_METHOD_WRITE__       __synchronizeMethodWrite     __methodSyncer = __synchronizeMethodWrite( *this);
00041 #define __LOW_SYNCHRONIZE_METHOD_READ_WEAK__   __synchronizeMethodReadWeak  __methodSyncer = __synchronizeMethodReadWeak( *this);
00042 #define __LOW_SYNCHRONIZE_METHOD_WRITE_WEAK__  __synchronizeMethodWriteWeak __methodSyncer = __synchronizeMethodWriteWeak( *this);
00043 
00044 #endif
00045 
00046 
00047 //
00048 // Macros for static synchronization
00049 //
00050 #define __LOW_SYNCHRONIZE_DEFINE_PROTECTED_LOCK__    static LOW_thread_rwlock *__staticSyncRwlockSingleton; \
00051                                                      static LOW_platformMiscFactory::threadIdent_t  __writeLockHolder;
00052 
00053 #define __LOW_SYNCHRONIZE_INIT_PROTECTED_LOCK__(X)   LOW_thread_rwlock* X::__staticSyncRwlockSingleton = 0; \
00054                                                      LOW_platformMiscFactory::threadIdent_t  X::__writeLockHolder = 0;
00055 
00056 #ifdef DEBUG_LOCKING
00057 
00058 #define __LOW_SYNCHRONIZE_STATIC_READ__        LOW_objectSynchronizer::__synchronizeStaticRead __staticSyncer = \
00059                                                  LOW_objectSynchronizer::__synchronizeStaticRead( &__staticSyncRwlockSingleton, __FILE__, __LINE__);
00060 #define __LOW_SYNCHRONIZE_STATIC_WRITE__       LOW_objectSynchronizer::__synchronizeStaticWrite __staticSyncer = \
00061                                                  LOW_objectSynchronizer::__synchronizeStaticWrite( &__staticSyncRwlockSingleton, __writeLockHolder, __FILE__, __LINE__);
00062 #define __LOW_SYNCHRONIZE_STATIC_READ_WEAK__   LOW_objectSynchronizer::__synchronizeStaticReadWeak __staticSyncer = \
00063                                                  LOW_objectSynchronizer::__synchronizeStaticReadWeak( &__staticSyncRwlockSingleton, __writeLockHolder, __FILE__, __LINE__);
00064 #define __LOW_SYNCHRONIZE_STATIC_WRITE_WEAK__  LOW_objectSynchronizer::__synchronizeStaticWriteWeak __staticSyncer = \
00065                                                  LOW_objectSynchronizer::__synchronizeStaticWriteWeak( &__staticSyncRwlockSingleton, __writeLockHolder, __FILE__, __LINE__);
00066 #else
00067 
00068 #define __LOW_SYNCHRONIZE_STATIC_READ__        LOW_objectSynchronizer::__synchronizeStaticRead __staticSyncer = \
00069                                                  LOW_objectSynchronizer::__synchronizeStaticRead( &__staticSyncRwlockSingleton);
00070 #define __LOW_SYNCHRONIZE_STATIC_WRITE__       LOW_objectSynchronizer::__synchronizeStaticWrite __staticSyncer = \
00071                                                  LOW_objectSynchronizer::__synchronizeStaticWrite( &__staticSyncRwlockSingleton, __writeLockHolder);
00072 #define __LOW_SYNCHRONIZE_STATIC_READ_WEAK__   LOW_objectSynchronizer::__synchronizeStaticReadWeak __staticSyncer = \
00073                                                  LOW_objectSynchronizer::__synchronizeStaticReadWeak( &__staticSyncRwlockSingleton, __writeLockHolder);
00074 #define __LOW_SYNCHRONIZE_STATIC_WRITE_WEAK__  LOW_objectSynchronizer::__synchronizeStaticWriteWeak __staticSyncer = \
00075                                                  LOW_objectSynchronizer::__synchronizeStaticWriteWeak( &__staticSyncRwlockSingleton, __writeLockHolder);
00076 
00077 #endif

Generated on Tue Feb 3 11:30:26 2004 for OneWireLibrary++ by doxygen 1.3.2