Mikhail Fursov wrote:
On 5/25/06, Mikhail Loenko <[EMAIL PROTECTED]> wrote:

> 2) Try to make all objects used for synchronization 'final'  (we have a
lot
> of non-final monitors in API, so we give a chance to bugs)

Could you please explain with details and an example?


This is not a bug (E.g. ExemptionMechanism:47, BeanContextSupport:149) but
such code may lead (in theory or in future) to deadlock because it allows
different threads to use different locks in the same object instance. Also
when you analyse 'synchronized' pattern the 'final' modifier for a lock
really helps in understanding code and locks logic.

Time for me to learn something - I thought there was only one monitor per object.... how can different threads get different locks?

geir


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to