previous | start | next

## Object Locks

- Each object has a lock
- Calling a `synchronized` method acquires lock of implicit parameter
- Leaving the `synchronized` method releases lock
- Easier than explicit `Lock` objects

      public class BoundedQueue<E>
      {
         public synchronized void add(E newValue) { . . . }
         public synchronized E remove() { . . . }
         . . .
      }

previous | start | next