mirror of
				https://github.com/GayPizzaSpecifications/voxelotl-engine.git
				synced 2025-11-04 10:59:39 +00:00 
			
		
		
		
	implement infinite worlds with threaded chunk generation
This commit is contained in:
		@ -62,6 +62,14 @@ public class ConcurrentDictionary<V: Hashable, T>: Collection {
 | 
			
		||||
      }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public func take() -> Dictionary<V, T> {
 | 
			
		||||
    self.locked {
 | 
			
		||||
      let current = self.inner
 | 
			
		||||
      self.inner = [:]
 | 
			
		||||
      return current
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  fileprivate func locked<X>(_ perform: () -> X) -> X {
 | 
			
		||||
    self.lock.lock()
 | 
			
		||||
    defer {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user