Cloudera interview question

How to implement a spinlock.