add spin/rw lock for linux version