Use the Conditions utility class instead of the open-coded lock/conditions stuff.