Added spinlock implementation