   private func findNonEmptyQueueIndex() -> Int? {
     let r = rng.next()
     let increment =
-      pool.totalThreadCount == 1 ? 1 : pool.coprimes[Int(r.reduced(into: UInt64(pool.coprimes.count)))]
-    var threadIndex = Int(r.reduced(into: UInt64(pool.totalThreadCount)))
-    for _ in 0..<pool.totalThreadCount {
-      if !pool.queues[threadIndex].isEmpty { return threadIndex }
+      totalThreadCount == 1 ? 1 : coprimes[Int(r.reduced(into: UInt64(coprimes.count)))]
+    var threadIndex = Int(r.reduced(into: UInt64(totalThreadCount)))
+    for _ in 0..<totalThreadCount {
+      if !queues[threadIndex].isEmpty { return threadIndex }
       threadIndex += increment
-      if threadIndex >= pool.totalThreadCount {
-        threadIndex -= pool.totalThreadCount
+      if threadIndex >= totalThreadCount {
+        threadIndex -= totalThreadCount
       }
     }
     return nil

  init(threadId: Int, pool: NonBlockingThreadPool<Environment>) {
    self.threadId = threadId
    self.pool = pool
    self.rng = PCGRandomNumberGenerator(state: UInt64(threadId))
  }
  let threadId: Int

      pool.condition.cancelWait()
      return nil
    }
    condition.commitWait(threadId)
    _ = pool.blockedCountStorage.decrement()
    return nil
  }
