The reason is that the lifecycle of the thread is exactly determined by
the port close. When this happens the port will stop to accept writes andI know, I wrote this code. All commits made by "beveloper" were written by
will finish to handle the eventual messages in the queue. Once the queue is
empty the next read return B_BAD_PORT_ID. This will usually happen in the
node destructor, which will wait for the thread and delete the port
definitely.
me, including all the media kit code committed by ejakowatz in hrev10.
Other than that this avoid to do two checks, the change makes more
esplicit when the object is supposed to die, since we will never getI disagree, previously the code explicitly allowed B_ERROR in addition to
B_TIMED_OUT or B_WOULD_BLOCK I see more logical to check against
B_BAD_PORT_ID for both efficiency and code explicitness.
B_OK results, all other errors exit the loop.
I think this micro optimization isn't useful. I really don't know why you
are wasting you time with something like this.
The loop rarely executes this comparision. But now you easily run into an
endless loop, but it's only priority 12 so I don't care.