[bugfix] spinlock is very easy deadlock when valgrind. so we replace it with mutex