add spinlock when remove or add to thread list.