applied rwlock to protect removeAll operation.