adding scoped_lock for spin mutex.