summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2015-05-28 07:59:57 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2015-05-28 07:59:57 +0200
commit52c36874e251c3ac5ff0f925c8133074166d481d (patch)
tree3e90a24d4db7e9fb3aec58ea1d0404f53299a4c2
parent979c5049ef6fdd55c29fa5170a96c62d2a8a6823 (diff)
downloadmariadb-git-bb-10.1-MDEV-8241.tar.gz
MDEV-8241: Debug build on Windows is broken: error LNK2019: unresolved external symbol pthread_detach referenced in function ma_checkpoint_initbb-10.1-MDEV-8241
pthread_detach() replaced with pthread_detach_this_thread() pthread_detach_this_thread() definition fixed
-rw-r--r--include/my_pthread.h2
-rw-r--r--storage/maria/ma_checkpoint.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 7770c28f45f..104e91715e7 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -182,7 +182,7 @@ int pthread_cancel(pthread_t thread);
#define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
-#define pthread_detach_this_thread()
+#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c
index 2268ca62875..36b729e6053 100644
--- a/storage/maria/ma_checkpoint.c
+++ b/storage/maria/ma_checkpoint.c
@@ -340,7 +340,6 @@ int ma_checkpoint_init(ulong interval)
{
/* thread lives, will have to be killed */
checkpoint_control.status= THREAD_RUNNING;
- pthread_detach(th);
}
}
DBUG_RETURN(res);
@@ -574,6 +573,8 @@ pthread_handler_t ma_checkpoint_background(void *arg)
sleeps= 1;
pages_to_flush_before_next_checkpoint= 0;
+ pthread_detach_this_thread();
+
for(;;) /* iterations of checkpoints and dirty page flushing */
{
#if 0 /* good for testing, to do a lot of checkpoints, finds a lot of bugs */