Introduce locking on objects as a programming concept
Objective
Enable the students to write simple critical sections
Exercise
A number of students share a house. If they look in
the fridge and there is no milk, then the student goes to the shop
to buy milk. How should a runnable Student class use the Fridge
class below to ensure that only one student ever goes to buy milk if
there is an empty fridge?