[haiku-development] Re: correct way to acquire_sem_etc()

  • From: <philippe.houdoin@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 29 Oct 2008 23:14:02 +0100

Stephan asked:

> In the ioctl() the result is checked for several possible errors, among 
> which is B_INTERRUPTED. All this happens in a while loop and in the 
> B_INTERRUPTED case, the thread will simply go back into the loop.
> 
> Now I have learned that killing the thread that does the ioctl() will
make
> it busy loop, because B_INTERRUPTED is returned from acquire_sem_etc().
> 
> How is this done the correct way?

By considering B_INTERRUPTED as an error and then simply returns from the
ioctl()?
Any signal raised by the caller thread, it will never be because user
pressed Ctrl+S to suspend it...

Philippe.


Other related posts: