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