int ret;  down(&kthread_stop_lock);  /* It could exit after stop_info.k set, but before wake_up_process. */ get_task_struct(k);  /* Must init completion *before* thread sees kthread_stop_info.k */ init_completion(&kthread_stop_info.done); smp_wmb();  /* Now set kthread_should_stop() to true, and wake it up. */ kthread_stop_info.k = k; wake_up_process(k); put_task_struct(k);  /* Once it dies, reset stop ptr, gather result and we're done. */ wait_for_completion(&kthread_stop_info.done); kthread_stop_info.k = NULL; ret = kthread_stop_info.err; up(&kthread_stop_lock);  return ret; 
return kthread_stop_sem(k, NULL); 
int kthread_stop(struct task_struct *k){	int ret;	down(&kthread_stop_lock);	/* It could exit after stop_info.k set, but before wake_up_process. */	get_task_struct(k);	/* Must init completion *before* thread sees kthread_stop_info.k */	init_completion(&kthread_stop_info.done);	smp_wmb();	/* Now set kthread_should_stop() to true, and wake it up. */	kthread_stop_info.k = k;	wake_up_process(k);	put_task_struct(k);	/* Once it dies, reset stop ptr, gather result and we're done. */	wait_for_completion(&kthread_stop_info.done);	kthread_stop_info.k = NULL;	ret = kthread_stop_info.err;	up(&kthread_stop_lock);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/61e1a9ea4b425eb8c3b4965c35fe953bd881728f/kthread.c/buggy/kernel/kthread.c