[haiku-bugs] Re: [Haiku] #9481: [patch] BMenuBar_Track() is not locking atomically

  • From: "jscipione" <trac@xxxxxxxxxxxx>
  • Date: Mon, 25 Feb 2013 23:37:27 -0000

#9481: [patch] BMenuBar_Track() is not locking atomically
----------------------------------+----------------------------
   Reporter:  jscipione           |      Owner:  axeld
       Type:  bug                 |     Status:  new
   Priority:  high                |  Milestone:  R1
  Component:  Kits/Interface Kit  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:  8539
Has a Patch:  1                   |   Platform:  All
----------------------------------+----------------------------
Description changed by jscipione:

Old description:

> Because the locking is not-atomic it can cause the app to crash if it is
> another thread unlocks the looper while this one is trying to use it.
> This 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?

New description:

 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?

--

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/9481#comment:2>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: