change mutex to spin