[openbeos] Re: suspend_thread in kernel

  • From: "Scott MacMaster" <scott@xxxxxxxxxxxxxxxxxx>
  • To: <openbeos@xxxxxxxxxxxxx>
  • Date: Fri, 9 Jan 2004 08:48:23 -0500

Well, that looks like it'll suspend the current thread (the thread doing the
spawning) unless that code is in the spawned code.  However, it would seem
odd to have the call to suspend in the spawned thread.  Try something like
this instead.

thread_id id = spawn_thread(function, "My Spawned Thread", priority, NULL);
suspend_thread(id);

or if for some weird reason you don't have the thread_id

thread_id id = find_thread("My Spawned Thread");
suspend_thread(id);


I can't say much about if this is way to do it in the kernel since I don't
know very much about programming in the kernel.


Later,
Scott MacMaster

----- Original Message ----- 
From: "Jérôme Duval" <korli@xxxxxxxx>
To: "openbeos" <openbeos@xxxxxxxxxxxxx>
Sent: Friday, January 09, 2004 5:02 AM
Subject: [openbeos] suspend_thread in kernel


> Hello all,
>
> i have a spawned kernel thread i would like to suspend and resume.
>
> I tried this : suspend_thread(find_thread(NULL)) but it seems the thread
keeps
> running. Is this the way to do it or did i miss something ?
>
> Regards,
>
> Jerome
>
>
>


Other related posts: