mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Performance patch: Mysql atomic patch
This commit is contained in:
@@ -18,13 +18,21 @@
|
||||
#define intptr void *
|
||||
|
||||
#ifndef MY_ATOMIC_MODE_RWLOCKS
|
||||
/*
|
||||
* Attempt to do atomic ops without locks
|
||||
*/
|
||||
#include "atomic/nolock.h"
|
||||
#endif
|
||||
|
||||
#ifndef make_atomic_cas_body
|
||||
#ifndef MY_ATOMIC_NOLOCK
|
||||
/*
|
||||
* Have to use rw-locks for atomic ops
|
||||
*/
|
||||
#include "atomic/rwlock.h"
|
||||
#endif
|
||||
|
||||
#ifndef MY_ATOMICS_MADE
|
||||
|
||||
#ifndef make_atomic_add_body
|
||||
#define make_atomic_add_body(S) \
|
||||
int ## S tmp=*a; \
|
||||
@@ -91,7 +99,7 @@ extern int ## S my_atomic_load ## S(int ## S volatile *a);
|
||||
#define make_atomic_store(S) \
|
||||
extern void my_atomic_store ## S(int ## S volatile *a, int ## S v);
|
||||
|
||||
#endif
|
||||
#endif /* HAVE_INLINE */
|
||||
|
||||
make_atomic_cas( 8)
|
||||
make_atomic_cas(16)
|
||||
@@ -129,6 +137,8 @@ make_atomic_swap(ptr)
|
||||
#undef make_atomic_swap_body
|
||||
#undef intptr
|
||||
|
||||
#endif /* MY_ATOMICS_MADE */
|
||||
|
||||
#ifdef _atomic_h_cleanup_
|
||||
#include _atomic_h_cleanup_
|
||||
#undef _atomic_h_cleanup_
|
||||
|
||||
Reference in New Issue
Block a user