summaryrefslogtreecommitdiff
path: root/client/mysqlimport.c
diff options
context:
space:
mode:
authorbrian@zim.(none) <>2006-02-25 18:03:11 -0800
committerbrian@zim.(none) <>2006-02-25 18:03:11 -0800
commit7234f79c4af026e51f201b667db1946b9312bd77 (patch)
tree1183a7d5011a8297b4a0f3095774641503dd4d89 /client/mysqlimport.c
parentf40705eb9b3db7f1896b43723e0ea84403e57e7d (diff)
downloadmariadb-git-7234f79c4af026e51f201b667db1946b9312bd77.tar.gz
This patch handles compiles with threads, namely if you don't have pthreads it will remove support for threads in the applications (and it is fixed in such a way that tests won't break).
Diffstat (limited to 'client/mysqlimport.c')
-rw-r--r--client/mysqlimport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 81040bed993..42d521a1412 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -29,12 +29,16 @@
#include "client_priv.h"
#include "mysql_version.h"
+#ifdef HAVE_LIBPTHREAD
#include <my_pthread.h>
+#endif
/* Global Thread counter */
int counter= 0;
+#ifdef HAVE_LIBPTHREAD
pthread_mutex_t counter_mutex;
+#endif
static void db_error_with_table(MYSQL *mysql, char *table);
static void db_error(MYSQL *mysql);
@@ -516,6 +520,7 @@ static char *field_escape(char *to,const char *from,uint length)
int exitcode= 0;
+#ifdef HAVE_LIBPTHREAD
pthread_handler_t worker_thread(void *arg)
{
int error;
@@ -554,6 +559,7 @@ error:
return 0;
}
+#endif
int main(int argc, char **argv)
@@ -571,6 +577,7 @@ int main(int argc, char **argv)
return(1);
}
+#ifdef HAVE_LIBPTHREAD
if (opt_use_threads && !lock_tables)
{
pthread_t mainthread; /* Thread descriptor */
@@ -621,6 +628,7 @@ loop_label:
VOID(pthread_mutex_destroy(&counter_mutex));
}
else
+#endif
{
MYSQL *mysql= 0;
if (!(mysql= db_connect(current_host,current_db,current_user,opt_password)))