synchronized
A Java monitor-based synchronization construct that provides mutual exclusion and establishes memory-visibility guarantees around a critical section.
Technical Context
The lock is associated with an object monitor, or with the Class object for a static synchronized method. Besides serializing execution, monitor exit happens-before a later monitor enter on the same monitor, which is why synchronized is also a memory-ordering primitive.
Related Concepts
- Java Memory Model
- monitor
- critical section
- ReentrantLock