Merge pull request #5441 from mqliang/Rlock-GET

store: use Rlock when GET
This commit is contained in:
Xiang Li 2016-05-25 11:29:36 -07:00
commit 9ea1705563

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 {