It prevents concurrent access to a resource. Sun’s got a pretty good description with examples.
More Related Contents:
- Synchronizing on String objects in Java
- Is java.sql.Connection thread safe?
- Java synchronized method lock on object, or method?
- Is iterating ConcurrentHashMap values thread safe?
- Is a HashMap thread-safe for different keys?
- Thread safe multitons in Java
- Is a volatile int in Java thread-safe?
- Use cases for RxJava schedulers
- How to stop a thread created by implementing runnable interface?
- Throttling javafx gui updates
- Are non-synchronised static methods thread safe if they don’t modify static class variables?
- Odd even number printing using thread
- How do I prove programmatically that StringBuilder is not threadsafe?
- Is Random class thread safe?
- Thread Confinement
- Testing initialization safety of final fields
- Is Cipher thread-safe?
- How to get the Context from anywhere? [duplicate]
- Is LinkedList thread-safe when I’m accessing it with offer and poll exclusively?
- Regarding thread safety of servlet [duplicate]
- Is it legal to call the start method twice on the same Thread?
- How to scale threads according to CPU cores?
- Should we use EventQueue.invokeLater for any GUI update in a Java desktop application?
- Is ConcurrentHashMap totally safe?
- In Java, how do you determine if a thread is running?
- When should we use Java’s Thread over Executor?
- Interview: How to ensure that a thread runs after another?
- why java security manager doesn’t forbid neither creating new Thread() nor starting it?
- How to restart thread in java? [duplicate]
- Random over ThreadLocalRandom