fix broken spinlock due to miscompilation