lock and condition example