Re: about kernel_thread!

From: linux-os
Date: Mon Dec 13 2004 - 07:33:48 EST


On Mon, 13 Dec 2004, Zhenyu Wu wrote:

Hello,

I have some confusions on kernel_thread, so I want to get help.

I want to create a thread in a loadable module, then I used the function
kernel_thread() in init_module(). Of course, the thread was created, but when I
remove the module there are errors. I think it is because of the thread I have
created that have not been killed. So, how can I kill this thread when I remove
the module?

Thanks,


You copy the method used in other kernel modules. This involves
a semaphore and having the module removing routine send the task
a signal. FYI, there is a wait_for_completion() routine and a
complete_and_exit() routine already defined.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by John Ashcroft.
98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/