title: Pausing and restarting a secondary, synchronous thread
body: <p>Using <code>DispatchQueue</code>, I can create a new thread, which I can run synchronously or asynchronously with the main thread:</p>
  
  <pre><code>import Foundation
  
  let thread = DispatchQueue(label: "thread")
  
  thread.sync {
      // Code here...
  }
  </code></pre>
  
  <p>What I have been trying to do is to run the separate thread to a certain point, pause it, continue running the main thread, and then go back the the secondary thread. Is that possible?</p>
  
  <p>Here is an illustration:</p>
  
  <pre><code>import Foundation
  
  let thread = DispatchQueue(label: "thread")
  
  thread.sync {
      print("Thread Started")
      // Pause Thread
      print("Thread Ended")
  }
  print("Before Thread Ended")
  // Start Thread
  print("After Thread Ended")
  </code></pre>
  
  <p>The desired output:</p>
  
  <pre><code>Thread Started
  Before Thread Ended
  Thread Ended
  After Thread Ended
  </code></pre>