From 02963b85e4feb9e19f287f4abc985c5b3da3e2ea Mon Sep 17 00:00:00 2001 From: David Calavera Date: Fri, 31 Jul 2015 09:48:55 -0700 Subject: [PATCH] Remove read index that causes dead lock. Let the iterator to lock the index when it needs it. Signed-off-by: David Calavera --- truncindex/truncindex.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/truncindex/truncindex.go b/truncindex/truncindex.go index a93fe1d..dba52d3 100644 --- a/truncindex/truncindex.go +++ b/truncindex/truncindex.go @@ -121,8 +121,6 @@ func (idx *TruncIndex) Get(s string) (string, error) { // Iterate iterates over all stored IDs, and passes each of them to the given handler. func (idx *TruncIndex) Iterate(handler func(id string)) { - idx.RLock() - defer idx.RUnlock() idx.trie.Visit(func(prefix patricia.Prefix, item patricia.Item) error { handler(string(prefix)) return nil