[interfacekit] Re: deadlock with BApplication/BWindow

Ingo Weinhold wrote:

_Lock(BLooper* loop, port_id port, bigtime_t timeout)
is always called with 'this' and '-1'
so 'loop' will always be valid. IsLooperValid() checks for 'loop' in the global
list and if not, return error. But this will always return true, unless the looper
has been deleted and this is an illegal call, in which case it's right to fail with
a segmentation fault.


Maybe I am missing something, and if that's the case, please tell me what.
If not, can we please remove the above lines? They are useless and introduce
lots of CPU cycles.


Your assumption that invoking BLooper::Lock() on an invalid looper is not allowed is not correct. It is completely OK to do that. Just like calling PostMessage().

Why? It would realise nothing. And it's wrong. Why do you say it's correct?


Adi.

Other related posts: