mariadb/ut/ut0auxconf.c
vasil 3c9bec1100 branches/zip:
Implement a check whether pthread_t objects can be used by GCC atomic
builtin functions. This check is implemented in plug.in and defines the
macro HAVE_ATOMIC_PTHREAD_T. This macro is checked in univ.i and the
relevant part of the code enabled (the one that uses GCC atomics against
pthread_t objects).

In addition to this, the same program that is compiled as part of the
plug.in check is added in ut/ut0auxconf.c. In the InnoDB Plugin source
archives that are shipped to the users, a generated Makefile.in is added.
That Makefile.in will be modified to compile ut/ut0auxconf.c and define
the macro HAVE_ATOMIC_PTHREAD_T if the compilation succeeds. I.e.
Makefile.in will emulate the work that is done by plug.in. This is done in
order to make the check happen and HAVE_ATOMIC_PTHREAD_T eventually
defined without regenerating MySQL's ./configure from
./storage/innobase/plug.in. The point is not to ask users to install the
autotools and regenerate ./configure.

rb://95

Approved by:	Marko
2009-03-05 14:38:59 +00:00

13 lines
161 B
C

#include <pthread.h>
int
main(int argc, char** argv)
{
pthread_t x1;
pthread_t x2;
pthread_t x3;
__sync_bool_compare_and_swap(&x1, x2, x3);
return(0);
}