Issue 3821 in pharo: makeStrong/makeWeak contains a bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3821 in pharo: makeStrong/makeWeak contains a bug

pharo
Status: Accepted
Owner: [hidden email]
CC: [hidden email],  [hidden email]
Labels: Milestone-1.3

New issue 3821 by [hidden email]: makeStrong/makeWeak contains a bug
http://code.google.com/p/pharo/issues/detail?id=3821

makeStrong/makeWeak contains a bug, because it is using #becomeForward:
but doesn't takes into account that subscription stored in a set ,
which is hash-based , so after become, the item will be at wrong
position.

So, we need to implement
announcer>>replace: subscription with: newOne

then
a) we don't have to use become
b) it will be thread safe, because you can protect replacement in
subscription registry with monitor

As an alternative, we can use Set instead of IdentitySet, and
implement #hash and #== for subscriptions
which don't changing when you switch between weak/strong. Then we can
keep using #becomeForward:

--
Best regards,
Igor Stasenko AKA sig.



Reply | Threaded
Open this post in threaded view
|

Re: Issue 3821 in pharo: makeStrong/makeWeak contains a bug

pharo
Updates:
        Status: FixToInclude

Comment #1 on issue 3821 by [hidden email]: makeStrong/makeWeak  
contains a bug
http://code.google.com/p/pharo/issues/detail?id=3821

(No comment was entered for this change.)

Attachments:
        Announcer-fix.2.cs  1.4 KB


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3821 in pharo: makeStrong/makeWeak contains a bug

pharo
Updates:
        Status: Closed

Comment #2 on issue 3821 by [hidden email]: makeStrong/makeWeak  
contains a bug
http://code.google.com/p/pharo/issues/detail?id=3821

in 13103