diff options
author | unknown <serg@janus.mylan> | 2006-10-21 20:06:56 +0200 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2006-10-21 20:06:56 +0200 |
commit | d1852da743be3a636bba35114d1342b4b11039f0 (patch) | |
tree | 5d16112cc42ea612fbd1a482f778e833125ca832 /include | |
parent | fb818dd7b0be3b4facd159de14bc3d9afcbcf16e (diff) | |
download | mariadb-git-d1852da743be3a636bba35114d1342b4b11039f0.tar.gz |
less confusing and more correct name for my_atomic_swap
Diffstat (limited to 'include')
-rw-r--r-- | include/atomic/rwlock.h | 2 | ||||
-rw-r--r-- | include/atomic/x86-gcc.h | 2 | ||||
-rw-r--r-- | include/atomic/x86-msvc.h | 2 | ||||
-rw-r--r-- | include/my_atomic.h | 22 |
4 files changed, 14 insertions, 14 deletions
diff --git a/include/atomic/rwlock.h b/include/atomic/rwlock.h index 3d8edb9e27e..5a3ca5a434e 100644 --- a/include/atomic/rwlock.h +++ b/include/atomic/rwlock.h @@ -47,7 +47,7 @@ typedef struct {pthread_mutex_t rw;} my_atomic_rwlock_t; #endif #define make_atomic_add_body(S) int ## S sav; sav= *a; *a+= v; v=sav; -#define make_atomic_swap_body(S) int ## S sav; sav= *a; *a= v; v=sav; +#define make_atomic_fas_body(S) int ## S sav; sav= *a; *a= v; v=sav; #define make_atomic_cas_body(S) if ((ret= (*a == *cmp))) *a= set; else *cmp=*a; #define make_atomic_load_body(S) ret= *a; #define make_atomic_store_body(S) *a= v; diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h index 0be8fdf9244..cd84faeee31 100644 --- a/include/atomic/x86-gcc.h +++ b/include/atomic/x86-gcc.h @@ -43,7 +43,7 @@ #define make_atomic_add_body(S) \ asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a)) #endif -#define make_atomic_swap_body(S) \ +#define make_atomic_fas_body(S) \ asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a)) #define make_atomic_cas_body(S) \ asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \ diff --git a/include/atomic/x86-msvc.h b/include/atomic/x86-msvc.h index 8f3e55aaed7..bd5a7fdd96c 100644 --- a/include/atomic/x86-msvc.h +++ b/include/atomic/x86-msvc.h @@ -43,7 +43,7 @@ _asm setz al \ _asm movzx ret, al \ } -#define make_atomic_swap_body(S) \ +#define make_atomic_fas_body(S) \ _asm { \ _asm mov reg_ ## S, v \ _asm xchg *a, reg_ ## S \ diff --git a/include/my_atomic.h b/include/my_atomic.h index 921b55e68a2..aad69295998 100644 --- a/include/my_atomic.h +++ b/include/my_atomic.h @@ -43,11 +43,11 @@ STATIC_INLINE int ## S my_atomic_add ## S( \ return v; \ } -#define make_atomic_swap(S) \ -STATIC_INLINE int ## S my_atomic_swap ## S( \ +#define make_atomic_fas(S) \ +STATIC_INLINE int ## S my_atomic_fas ## S( \ int ## S volatile *a, int ## S v) \ { \ - make_atomic_swap_body(S); \ + make_atomic_fas_body(S); \ return v; \ } @@ -80,8 +80,8 @@ STATIC_INLINE void my_atomic_store ## S( \ #define make_atomic_add(S) \ extern int ## S my_atomic_add ## S(int ## S volatile *a, int ## S v); -#define make_atomic_swap(S) \ -extern int ## S my_atomic_swap ## S(int ## S volatile *a, int ## S v); +#define make_atomic_fas(S) \ +extern int ## S my_atomic_fas ## S(int ## S volatile *a, int ## S v); #define make_atomic_cas(S) \ extern int my_atomic_cas ## S(int ## S volatile *a, int ## S *cmp, int ## S set); @@ -113,10 +113,10 @@ make_atomic_store(16) make_atomic_store(32) make_atomic_store(ptr) -make_atomic_swap( 8) -make_atomic_swap(16) -make_atomic_swap(32) -make_atomic_swap(ptr) +make_atomic_fas( 8) +make_atomic_fas(16) +make_atomic_fas(32) +make_atomic_fas(ptr) #ifdef _atomic_h_cleanup_ #include _atomic_h_cleanup_ @@ -127,12 +127,12 @@ make_atomic_swap(ptr) #undef make_atomic_cas #undef make_atomic_load #undef make_atomic_store -#undef make_atomic_swap +#undef make_atomic_fas #undef make_atomic_add_body #undef make_atomic_cas_body #undef make_atomic_load_body #undef make_atomic_store_body -#undef make_atomic_swap_body +#undef make_atomic_fas_body #undef intptr #ifndef LF_BACKOFF |