Exercise 3.49
Examples in section 3.4 (Mechanisms for Controlling Concurrency)