title: Where and why deadlock?
body: <p>I have 2 concurrent queues:</p>
  <pre><code>let concurrentQueue = DispatchQueue(label: &quot;test.concurrent&quot;, attributes: .concurrent)
  let syncQueue = DispatchQueue(label: &quot;test.sync&quot;, attributes: .concurrent)
  </code></pre>
  <p>And code:</p>
  <pre><code>for index in 1...65 {
      concurrentQueue.async {
          self.syncQueue.async(flags: .barrier) {
              print(&quot;WRITE \(index)&quot;)
          }
          
          self.syncQueue.sync {
              print(&quot;READ \(index)&quot;)
          }
      }
  }
  </code></pre>
  <p>Outputs:</p>
  <pre><code>WRITE 1
  READ 1
  </code></pre>
  <p>Why, where and how it gets deadlock?</p>
  <p>With &lt;65 iterations count everything is good.</p>