mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 22:12:30 +01:00
58e2fde011
Conflicts ========= Text conflict in .bzr-mysql/default.conf Text conflict in libmysqld/CMakeLists.txt Text conflict in libmysqld/Makefile.am Text conflict in mysql-test/collections/default.experimental Text conflict in mysql-test/extra/rpl_tests/rpl_row_sp006.test Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result Text conflict in mysql-test/suite/rpl/r/rpl_loaddata_fatal.result Text conflict in mysql-test/suite/rpl/r/rpl_row_create_table.result Text conflict in mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result Text conflict in mysql-test/suite/rpl/r/rpl_stm_log.result Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result Text conflict in mysql-test/t/mysqlbinlog.test Text conflict in sql/CMakeLists.txt Text conflict in sql/Makefile.am Text conflict in sql/log_event_old.cc Text conflict in sql/rpl_rli.cc Text conflict in sql/slave.cc Text conflict in sql/sql_binlog.cc Text conflict in sql/sql_lex.h 21 conflicts encountered. NOTE ==== mysql-5.1-rpl-merge has been made a mirror of mysql-next-mr: - "mysql-5.1-rpl-merge$ bzr pull ../mysql-next-mr" This is the first cset (merge/...) committed after pulling from mysql-next-mr.
156 lines
3.8 KiB
C
156 lines
3.8 KiB
C
#ifndef MY_ATOMIC_INCLUDED
|
|
#define MY_ATOMIC_INCLUDED
|
|
|
|
/* Copyright (C) 2006 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
#ifndef my_atomic_rwlock_init
|
|
|
|
#define intptr void *
|
|
|
|
#ifndef MY_ATOMIC_MODE_RWLOCKS
|
|
/*
|
|
* Attempt to do atomic ops without locks
|
|
*/
|
|
#include "atomic/nolock.h"
|
|
#endif
|
|
|
|
#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; \
|
|
while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \
|
|
v=tmp;
|
|
#endif
|
|
|
|
#ifdef HAVE_INLINE
|
|
|
|
#define make_atomic_add(S) \
|
|
STATIC_INLINE int ## S my_atomic_add ## S( \
|
|
int ## S volatile *a, int ## S v) \
|
|
{ \
|
|
make_atomic_add_body(S); \
|
|
return v; \
|
|
}
|
|
|
|
#define make_atomic_swap(S) \
|
|
STATIC_INLINE int ## S my_atomic_swap ## S( \
|
|
int ## S volatile *a, int ## S v) \
|
|
{ \
|
|
make_atomic_swap_body(S); \
|
|
return v; \
|
|
}
|
|
|
|
#define make_atomic_cas(S) \
|
|
STATIC_INLINE int my_atomic_cas ## S(int ## S volatile *a, \
|
|
int ## S *cmp, int ## S set) \
|
|
{ \
|
|
int8 ret; \
|
|
make_atomic_cas_body(S); \
|
|
return ret; \
|
|
}
|
|
|
|
#define make_atomic_load(S) \
|
|
STATIC_INLINE int ## S my_atomic_load ## S(int ## S volatile *a) \
|
|
{ \
|
|
int ## S ret; \
|
|
make_atomic_load_body(S); \
|
|
return ret; \
|
|
}
|
|
|
|
#define make_atomic_store(S) \
|
|
STATIC_INLINE void my_atomic_store ## S( \
|
|
int ## S volatile *a, int ## S v) \
|
|
{ \
|
|
make_atomic_store_body(S); \
|
|
}
|
|
|
|
#else /* no inline functions */
|
|
|
|
#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_cas(S) \
|
|
extern int my_atomic_cas ## S(int ## S volatile *a, int ## S *cmp, int ## S set);
|
|
|
|
#define make_atomic_load(S) \
|
|
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 /* HAVE_INLINE */
|
|
|
|
make_atomic_cas( 8)
|
|
make_atomic_cas(16)
|
|
make_atomic_cas(32)
|
|
make_atomic_cas(ptr)
|
|
|
|
make_atomic_add( 8)
|
|
make_atomic_add(16)
|
|
make_atomic_add(32)
|
|
|
|
make_atomic_load( 8)
|
|
make_atomic_load(16)
|
|
make_atomic_load(32)
|
|
make_atomic_load(ptr)
|
|
|
|
make_atomic_store( 8)
|
|
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)
|
|
|
|
#undef make_atomic_add
|
|
#undef make_atomic_cas
|
|
#undef make_atomic_load
|
|
#undef make_atomic_store
|
|
#undef make_atomic_swap
|
|
#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 intptr
|
|
|
|
#endif /* MY_ATOMICS_MADE */
|
|
|
|
#ifdef _atomic_h_cleanup_
|
|
#include _atomic_h_cleanup_
|
|
#undef _atomic_h_cleanup_
|
|
#endif
|
|
|
|
#define MY_ATOMIC_OK 0
|
|
#define MY_ATOMIC_NOT_1CPU 1
|
|
extern int my_atomic_initialize();
|
|
|
|
#endif
|
|
|
|
#endif /* MY_ATOMIC_INCLUDED */
|