store: use Rlock when GET

release-3.0
mqliang 2016-05-24 17:11:49 +08:00
parent f20573b576
commit ffd3cb78d4
1 changed files with 2 additions and 2 deletions

View File

@ -119,8 +119,8 @@ func (s *store) Index() uint64 {
func (s *store) Get(nodePath string, recursive, sorted bool) (*Event, error) {
var err *etcdErr.Error
s.worldLock.Lock()
defer s.worldLock.Unlock()
s.worldLock.RLock()
defer s.worldLock.RUnlock()
defer func() {
if err == nil {