Can a solution similar to [this](http://stackoverflow.com/questions/2718138/lightweight-spinlocks-built-from-gcc-atomic-operations) be used? It does require CAS though.