Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
77311570
Commit
77311570
authored
Oct 23, 2003
by
monty@narttu.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use atomic add for not critical statistics.
parent
1febfbe8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
include/my_pthread.h
include/my_pthread.h
+1
-3
No files found.
include/my_pthread.h
View file @
77311570
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment