[haiku-commits] Re: BRANCH waddlesplash-github.tracker_cleanup_threads_properly [9749bc4c0ab9] src/kits/tracker

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 30 Apr 2017 08:55:30 +0200

On 30.04.2017 01:46, waddlesplash wrote:

On Sat, Apr 29, 2017 at 5:32 PM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx
<mailto:axeld@xxxxxxxxxxxxxxxx>> wrote:
        -                       if (!lock.Lock()) {
        +                       if (!lock.LockWithTimeout(1000000)) {


    Do you really have to do that? Can't you simply delete the lock
    instead? That would be a good way to let lockers fail immediately.

Unless I really missed something, the lock is the looper lock for the
BPoseView, and this code will deadlock in the destructor unless there is
a mechanism for it to timeout. So, no, that's not an option.

I'm not familiar with the code in question, but generally, if you have code paths with inverse locking order, the solution should be to fix that, not to work around with timeouts.

CU, Ingo


Other related posts: