title: Inout parameter in async callback does not work as expected
body: <p>I'm trying to insert functions with <code>inout</code> parameter to append data received from async callback to an outside array. However, it does not work. And I tried everything I know to find out why - with no luck.</p>
  
  <p>As advised by @AirspeedVelocity, I rewrote the code as follows to remove unnecessary dependencies. I also use an <code>Int</code> as the <code>inout</code> parameter to keep it simple.<br>The output is always:<br>
  <code>c before: 0</code><br>
  <code>c after: 1</code></p>
  
  <p>I'm not able to figure out what goes wrong here.</p>
  
  <pre><code>func getUsers() {
      let u = ["bane", "LiweiZ", "rdtsc", "ssivark", "sparkzilla", "Wogef"]
      var a = UserData()
      a.userIds = u
      a.dataProcessor()
  }
  
  struct UserData {
      var userIds = [String]()
      var counter = 0
      mutating func dataProcessor() -&gt; () {
          println("counter: \(counter)")
          for uId in userIds {
              getOneUserApiData(uriBase + "user/" + uId + ".json", &amp;counter)
          }
      }
  }
  
  func getOneUserApiData(path: String, inout c: Int) {
      var req = NSURLRequest(URL: NSURL(string: path)!)
      var config = NSURLSessionConfiguration.ephemeralSessionConfiguration()
      var session = NSURLSession(configuration: config)
      var task = session.dataTaskWithRequest(req) {
          (data: NSData!, res: NSURLResponse!, err: NSError!) in
          println("c before: \(c)")
          c++
          println("c after: \(c)")
          println("thread on: \(NSThread.currentThread())")
      }
  
      task.resume()
  }
  </code></pre>
  
  <p>Thanks.</p>