lkml.org 
[lkml]   [2000]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] pcmcia event thread. (fwd)
Date
From
> > up_and_exit() would do it. Or preferably passing the address of the
> > semaphore as an extra argument to kernel_thread() in the first place.
>
> Any solution which involves a function being called from a kernel
> thread, and/or passing another arg to a kernel thread, is a non-starter
> ... See the discussion about timer_exit() a while ago. This sort of

timer_exit is a completely unrelated situation

> IMHO it is possible to solve this in a generic way without having to
> change the code for every single kernel thread.

It comes entirely down to one thing. The termination function of the thread
has to be code in the kernel code not a module. Thats it, nothing else. So
you just need some kind of sleep/wakeup proceedure for it.

As far as I can see all you need is


wait_and_die(sem)
{
up(&sem); /* In the kernel so can unload */
sys_exit(0); /* Never return to the unloaded module code */
}

in the main kernel. In fact if you were bored you could build this on the kernel
stack ;)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.147 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site