title: DispatchQueue sync vs sync barrier in concurrent queue
body: <p>I was going through DispatchQueue barrier and noticed both there are two ways <code>async(flags: .barrier)</code> and <code>sync(flags: .barrier)</code></p>
  
  <p>I understood the use of the async barrier but confused with the sync barrier.</p>
  
  <p>My confusion the task I want to do can be performed with this also</p>
  
  <pre><code>DispatchQueue.global().sync {
  
  }
  </code></pre>
  
  <p>then what is the use of sync barrier? Why they are used? and how  different in this.</p>
  
  <pre><code>DispatchQueue.global().sync(flags: .barrier) {
  
  }
  </code></pre>