Specifications
Sun Services
Java™ Programming Language
Module 13, slide 17 of 37
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The Object Lock Flag
• Every object has a flag that is a type of lock flag.
• The synchronized enables interaction with the lock
flag.
Object this
public void push(char c) {
synchronized (this) {
data[idx] = c;
idx++;
}
}
Thread before synchronized(this)
Code or
Behavior
Data or
State










