add spin lock and timer and test on lock.