Different types of locks for different needs and with different behavior are assembled in the java.util.concurrent.locks package.
The java.util.concurrent.atomic package provides support for lock-free, thread-safe programming on single variables.
The following classes provide synchronization support too:
- Semaphore: This restricts the number of threads that can access some resource
- CountDownLatch: This allows one or more threads to wait until a set of operations being performed in other threads are completed
- CyclicBarrier: This allows a set of threads to wait for each other to reach a common barrier point
- Phaser: This provides a more flexible form of barrier that may be used to control phased computation among multiple threads ...