sophia: switch to atomic-based spinlock