change file lock to spinlock