Opened 8 years ago

Closed 8 years ago

#9481 closed bug (fixed)

[patch] BMenuBar_Track() is not locking atomically

Reported by: jscipione Owned by: axeld
Priority: high Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #8539
Platform: All

Description (last modified by jscipione)

Because the locking is not-atomic it can cause the app to crash if another thread detaches the menu bar from the window while this method is trying to use it.

The attached patch fixes the problem for me and I detect no regressions but I'd like someone to take a second look. It was discovered while I was attempting to fix #8539 and is (partially) responsible for causing that bug.

Can someone with experience with BMenuBar and BHandler/BLooper take a look at my patch and see if there are any problems with it?

Attachments (1)

0001-Use-LockLooper-in-BMenuBar-_Track-which-is-atomic.patch (2.9 KB ) - added by jscipione 8 years ago.
Patch that replaces window->(Un)Lock() with (Un)LockLooper()

Download all attachments as: .zip

Change History (5)

by jscipione, 8 years ago

Patch that replaces window->(Un)Lock() with (Un)LockLooper()

comment:1 by jscipione, 8 years ago

patch: 01

comment:2 by jscipione, 8 years ago

Description: modified (diff)

comment:3 by hamish, 8 years ago

This change looks good to me.

The Window() == NULL check on 575 can now be eliminated, as LockLooper() accomplishes this for you.

comment:4 by jscipione, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev45340

Note: See TracTickets for help on using tickets.