Couchbase interview question

Implement a spin-lock using c++ to demonstrate its usage