Getting rid of this line will cause a deadlock. I forgot exactly where the write lock is acquired that caused the deadlock. But s.mutex is a big lock, may be we should use a finer grained lock instead.