mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Remove read index that causes dead lock.
Let the iterator to lock the index when it needs it. Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
		
							parent
							
								
									9e9f3aa36b
								
							
						
					
					
						commit
						5ed84009b3
					
				
					 1 changed files with 0 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue