I'm none to familiar with this code, but the change in behaviour looks rather drastic.
Before: a ConnectionSurfaceMap mutex is locked using "execute around method" and ownership isn't shared. Any actions on the MirSurface are under lock.
After: ownership is being shared meaning the MirSurface can be accessed without the lock.
Far from being "safer and more powerful" it will require the reviewer to invest significant thought to ensure that the changed behaviour doesn't violate consistency assumptions made elsewhere in the code.
I'm none to familiar with this code, but the change in behaviour looks rather drastic.
Before: a ConnectionSurfa ceMap mutex is locked using "execute around method" and ownership isn't shared. Any actions on the MirSurface are under lock.
After: ownership is being shared meaning the MirSurface can be accessed without the lock.
Far from being "safer and more powerful" it will require the reviewer to invest significant thought to ensure that the changed behaviour doesn't violate consistency assumptions made elsewhere in the code.
Why is this necessary?