Implemented simple spinlock