rewrite lock to float