On Monday, 6 July 2015 at 20:56:04 UTC, Frank Pagliughi wrote:
    void set_result(int retCode) {
      synchronized (mut) {
        this.retCode = retCode;
        completed = true;
        cond.notify();
      }
    }

    int get_result() {
      synchronized (mut) {
        while (!completed)
          cond.wait();
        return retCode;
    }

Instead of pulling values out, have you considered pushing them? E.g. by supplying a delegate that gets called when the asynchronous action completed.

Reply via email to