mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
store: use Rlock when GET
This commit is contained in:
parent
f20573b576
commit
ffd3cb78d4
@ -119,8 +119,8 @@ func (s *store) Index() uint64 {
|
|||||||
func (s *store) Get(nodePath string, recursive, sorted bool) (*Event, error) {
|
func (s *store) Get(nodePath string, recursive, sorted bool) (*Event, error) {
|
||||||
var err *etcdErr.Error
|
var err *etcdErr.Error
|
||||||
|
|
||||||
s.worldLock.Lock()
|
s.worldLock.RLock()
|
||||||
defer s.worldLock.Unlock()
|
defer s.worldLock.RUnlock()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user