소스 검색

Acquire exclusive lock when updating (#1025)

Dhruva Krishnamurthy 8 년 전
부모
커밋
d9815cdf0f
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      ring.go

+ 2 - 2
ring.go

@@ -142,8 +142,8 @@ type clusterMetadata struct {
 }
 
 func (c *clusterMetadata) setPartitioner(partitioner string) {
-	c.mu.RLock()
-	defer c.mu.RUnlock()
+	c.mu.Lock()
+	defer c.mu.Unlock()
 
 	if c.partitioner != partitioner {
 		// TODO: update other things now