Google Interview Question

use semaphore to implement mutex