Apple interview question

How do you implement a mutex in OS?