Local database reading edition

What 'synchronized' does to a method?

Reconstructed from database records, not a captured original forum layout. Dates and display names are retained as recorded; timezone and real-world identity are not inferred. Historical advice, contact details and offers are not current. Original markup is shown as inert text.

Forum index · Java - Tips Of The Day

Opening post

Asha · 2001-04-03 16:24:07

When you synchronize a method of a class, as in: public synchronized int getAge(){ ... } that method will acquire a monitor lock before execution. If the synchronized method is static, e.g. a class method, the lock is obtained over the class. Otherwise, the lock is obtained over an instance object of the class. Asha Balasubramanyan http://www.ammu.org

Source notes

MyCommunity/nandighosha.org.zip!/forum/tools/snitz_forums_2000.mdb
Table: FORUM_TOPICS + FORUM_REPLY · record IDs: 72