java - Can I make an overridden method synchronized? -
i overriding method superclass, want method synchronized. allowed? alternative?
yes, it's allowed doesn't change contract implementation.
think add synchronized block :
synchronized(this) {
just @ start of method, achieve same result. there other (possibly hidden) locks deeper in method, makes part of implementation rather api.
Comments
Post a Comment