00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _LOCK_TIMING_H_
00025 #define _LOCK_TIMING_H_
00026
00027 #if defined(REPOS_PERF_DEBUG)
00028
00029 class ReadersWritersLock;
00030
00031
00032 void rwlock_acquire_read_start(ReadersWritersLock *lock_p);
00033
00034 #define RWLOCK_ACQUIRE_READ_START(lock) rwlock_acquire_read_start(lock)
00035
00036 void rwlock_acquire_read_done(ReadersWritersLock *lock_p, bool failed);
00037
00038 #define RWLOCK_ACQUIRE_READ_DONE(lock, fail) rwlock_acquire_read_done(lock, fail)
00039
00040 void rwlock_acquire_write_start(ReadersWritersLock *lock_p);
00041
00042 #define RWLOCK_ACQUIRE_WRITE_START(lock) rwlock_acquire_write_start(lock)
00043
00044 void rwlock_acquire_write_done(ReadersWritersLock *lock_p,bool failed);
00045
00046 #define RWLOCK_ACQUIRE_WRITE_DONE(lock, fail) rwlock_acquire_write_done(lock, fail)
00047
00048 void rwlock_release_start(ReadersWritersLock *lock_p);
00049
00050 #define RWLOCK_RELEASE_START(lock) rwlock_release_start(lock)
00051
00052 void rwlock_release_done(ReadersWritersLock *lock_p);
00053
00054 #define RWLOCK_RELEASE_DONE(lock) rwlock_release_done(lock)
00055
00056
00057 void rwlock_locked_reason(ReadersWritersLock *lock_p, const char *reason);
00058
00059 #define RWLOCK_LOCKED_REASON(lock,reason) rwlock_locked_reason(lock,reason)
00060
00061 #if defined(__cplusplus)
00062
00063
00064 void rwlock_timing_control(bool enable);
00065
00066 #endif
00067
00068 #else // defined(REPOS_PERF_DEBUG)
00069
00070 #define RWLOCK_ACQUIRE_READ_START(lock) ((void)0)
00071 #define RWLOCK_ACQUIRE_READ_DONE(lock, fail) ((void)0)
00072 #define RWLOCK_ACQUIRE_WRITE_START(lock) ((void)0)
00073 #define RWLOCK_ACQUIRE_WRITE_DONE(lock, fail) ((void)0)
00074 #define RWLOCK_RELEASE_START(lock) ((void)0)
00075 #define RWLOCK_RELEASE_DONE(lock) ((void)0)
00076 #define RWLOCK_LOCKED_REASON(lock,reason) ((void)0)
00077
00078 #endif // defined(REPOS_PERF_DEBUG)
00079
00080 #endif