Clicky

Synchronized blocks vs Locks

  1. lock.lock and lock.unlock can be called from different methods. Syncronized blocks can only contain a single method.
  2. Synchronized blocks are always reentrant.
  3. Synchronized blocks do not guarantee fairness, locks can via constructur new ReentrantLock(true);