[interfacekit] Re: Fwd: BAutolock

"Marcus Overhagen" <ml@xxxxxxxxxxxx> wrote:
> > > Oh my god :-)
> > Eheheh! :=)
> > BTW, I noticed lots of acquire_sem without the check for
> > B_INTERRUPTED also in our app_server.
> > We should either "fix" them or switch to blockers (didn't Be, 
> > Inc. use benaphores for the real app_server?)
> As long as a thread isn't resumed or suspended 
> by resume_thread(), suspend_thread()
> or is send a signal, a semaphore doesn't return B_INTERRUPTED, 
> so it's save to skip that check (at least that's what I think).

That depends on what you do. Often, a B_INTERRUPTED is not want you 
want to get back in any circumstances, sometimes it doesn't matter.
In normal situations, a semaphore lock won't get interrupted - but you 
can't and shouldn't count on that.

> > And also in the BAutoLock code.
> > And also in the BDirectWindow code I sent to Marcus (Marcus? 
> > Still around ?).

In any case, I would "swallow" B_INTERRUPTED in any public API - you 
never know what a client does, and you better make it work in all 
cases.

Adios...
   Axel.


Other related posts: