diff options
author | unknown <monty@narttu.mysql.fi> | 2003-10-23 13:07:13 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-10-23 13:07:13 +0300 |
commit | cd9b28f0dc804456f19801b75d8a8099dabd05c6 (patch) | |
tree | 7b57956d142f8e91f0957a5ef58734846d16607b /include | |
parent | 21713178b64a19808e70fed3acf8123208d60e8a (diff) | |
download | mariadb-git-cd9b28f0dc804456f19801b75d8a8099dabd05c6.tar.gz |
Don't use atomic add for not critical statistics.
Diffstat (limited to 'include')
-rw-r--r-- | include/my_pthread.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index 424452a9298..82a2bb1accc 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -669,8 +669,6 @@ extern pthread_t shutdown_th, main_th, signal_th; #define thread_safe_increment(V,L) atomic_add(1,(atomic_t*) &V); #define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V); #define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V); -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) #else #define thread_safe_increment(V,L) \ pthread_mutex_lock((L)); (V)++; pthread_mutex_unlock((L)); @@ -678,6 +676,7 @@ extern pthread_t shutdown_th, main_th, signal_th; pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L)); #define thread_safe_sub(V,C,L) \ pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L)); +#endif /* HAVE_ATOMIC_ADD */ #ifdef SAFE_STATISTICS #define statistic_increment(V,L) thread_safe_increment((V),(L)) #define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) @@ -685,7 +684,6 @@ extern pthread_t shutdown_th, main_th, signal_th; #define statistic_increment(V,L) (V)++ #define statistic_add(V,C,L) (V)+=(C) #endif /* SAFE_STATISTICS */ -#endif /* HAVE_ATOMIC_ADD */ #endif /* thread_safe_increment */ #ifdef __cplusplus |