Messages in this thread | | | Date | Fri, 28 May 1999 19:25:05 +0200 | From | Gabor Lenart <> | Subject | kernel thread question |
| |
Hi,
I've got an own kernel thread which do something at every seconds :
int mythread ( void * unused ) { struct task_struct *tsk = current; /* stuffs, some task information cosmetic */ for (;;} { /* usefull stuff here */ tsk->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ); } }
And I create the thread with :
kernel_thread(mythread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
(I borrow the thread skeleton by learning from code of kswapd thread :)
But I've got some question :
* How can I sleep the thread to wake up only by an external effect (like calling a function from the other point of kernel, outside the thread) * How can I destroy the thread by a function inside the thread * How can I destroy the thread by a function outside the thread
I hope questions were clear enough despite of my poor English.
Thx : LGB, -- ---[ LGB/DC ]------------[ University Of Veszprém ]------[ Lénárt Gábor ]--- Ready to love, ready to fly. Ready to fail, ready to flow, ready to die ... ---[ 88/422022(4602) ]---[ http://lgb.hal.vein.hu ]---------[ 87/477074 ]--- finger lgb@hal2000.hal.vein.hu for more information including my PGP&GEEK code
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |