diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index de8a9610..6f2a2ff 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -333,14 +333,18 @@ int ma_checkpoint_init(ulong interval) res= 1; else if (interval > 0) { + pthread_attr_t attr; compile_time_assert(sizeof(void *) >= sizeof(ulong)); + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (!(res= mysql_thread_create(key_thread_checkpoint, - &th, NULL, ma_checkpoint_background, + &th, &attr, ma_checkpoint_background, (void *)interval))) { /* thread lives, will have to be killed */ checkpoint_control.status= THREAD_RUNNING; } + pthread_attr_destroy(&attr); } DBUG_RETURN(res); }