CS162 Operating Systems and Systems Programming Lecture 7 Semaphores, Conditional Variables, Deadlocks