diff --git a/modules/cas_cache/threads.c b/modules/cas_cache/threads.c index d4d5f80..3ffcd42 100644 --- a/modules/cas_cache/threads.c +++ b/modules/cas_cache/threads.c @@ -50,9 +50,10 @@ static int _cas_io_queue_thread(void *data) WARN(ocf_queue_pending_io(q), "Still pending IO requests\n"); /* If we get here, then thread was signalled to terminate. - * So, let's complete and exit. + * So, let's free memory and exit. */ - complete_and_exit(&info->compl, 0); + printk(KERN_DEBUG "Thread %s stopped\n", info->name); + kfree(info); return 0; } @@ -201,13 +202,9 @@ static void _cas_start_thread(struct cas_thread_info *info) static void _cas_stop_thread(struct cas_thread_info *info) { if (info->running && info->thread) { - init_completion(&info->compl); atomic_set(&info->stop, 1); wake_up(&info->wq); - wait_for_completion(&info->compl); - printk(KERN_DEBUG "Thread %s stopped\n", info->name); } - kfree(info); } int cas_create_queue_thread(ocf_queue_t q, int cpu)