switch to custom spinlock implementation (macosx support).