From 069eec35ae76104fd3d3ed0bc931171ba52a6f52 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 26 Nov 2009 01:18:23 +0200 Subject: [PATCH] Fixed LPBUG#485443 --with-fast-mutexes and without safe mutexes (debug build) maria do not builds Added 'mariadb_SERVER' as extra config group for MariaDB embedded server client/mysql.cc: Cleanup Added 'mariadb_SERVER' as extra config group for MariaDB embedded server mysys/thr_mutex.c: Fixed LPBUG#485443 --with-fast-mutexes and without safe mutexes (debug build) maria do not builds --- client/mysql.cc | 5 ++--- mysys/thr_mutex.c | 31 +++++-------------------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index fa03202f2d3..da35d96166b 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -83,7 +83,7 @@ extern "C" { #include #endif #endif -#endif +#endif /* defined(HAVE_CURSES_H) && defined(HAVE_TERM_H) */ #undef bcmp // Fix problem with new readline #if defined(__WIN__) @@ -92,7 +92,6 @@ extern "C" { #include #define HAVE_READLINE #endif - //int vidattr(long unsigned int attrs); // Was missing in sun curses } #if !defined(HAVE_VIDATTR) @@ -1024,7 +1023,7 @@ static const char *load_default_groups[]= { "mysql","client",0 }; static int embedded_server_arg_count= 0; static char *embedded_server_args[MAX_SERVER_ARGS]; static const char *embedded_server_groups[]= -{ "server", "embedded", "mysql_SERVER", 0 }; +{ "server", "embedded", "mysql_SERVER", "mariadb_SERVER", 0 }; #ifdef HAVE_READLINE /* diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index b5abf987461..5ab1e443a88 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -36,6 +36,7 @@ #undef pthread_mutex_init #undef pthread_mutex_lock #undef pthread_mutex_unlock +#undef pthread_mutex_trylock #undef pthread_mutex_destroy #undef pthread_cond_wait #undef pthread_cond_timedwait @@ -838,31 +839,9 @@ static void print_deadlock_warning(safe_mutex_t *new_mutex, DBUG_VOID_RETURN; } +#elif defined(MY_PTHREAD_FASTMUTEX) -#endif /* THREAD && SAFE_MUTEX */ - -#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) - -#include "mysys_priv.h" -#include "my_static.h" -#include - -#include -#include -#include -#include -#include - -#undef pthread_mutex_t -#undef pthread_mutex_init -#undef pthread_mutex_lock -#undef pthread_mutex_trylock -#undef pthread_mutex_unlock -#undef pthread_mutex_destroy -#undef pthread_cond_wait -#undef pthread_cond_timedwait - -ulong mutex_delay(ulong delayloops) +static ulong mutex_delay(ulong delayloops) { ulong i; volatile ulong j; @@ -943,6 +922,6 @@ void fastmutex_global_init(void) cpu_count= sysconf(_SC_NPROCESSORS_CONF); #endif } - -#endif /* SAFE_MUTEX_DEFINED */ + +#endif /* defined(MY_PTHREAD_FASTMUTEX) */ #endif /* THREAD */