00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #define DEBUG_LOCKING
00023
00024
00025
00026
00027
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
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