Apple interview question

How to implement a mutex in assembly