title: Swift wait for closure thread to finish
body: <p>I'm using a very simple swift project created with SPM where it includes Alamofire.</p>
  
  <p>main.swift:</p>
  
  <pre><code>import Alamofire
  
  Alamofire.request("https://google.com").responseString(queue: queue) { response in
              print("\(response.result.isSuccess)")
  }
  </code></pre>
  
  <p>The closure is never executed if I don't use a lock.
  Is there a way to instruct to wait for all threads or that specific thread before exiting? </p>
  
  <p>I'm aware this can be easily achieved using Playgrounds.</p>