~brandontschaefer/mir/first-round-deprecation

« back to all changes in this revision

Viewing changes to src/client/no_tls_future-inl.h

  • Committer: Brandon Schaefer
  • Date: 2016-12-13 17:59:30 UTC
  • mfrom: (3787.1.93 development-branch)
  • Revision ID: brandon.schaefer@canonical.com-20161213175930-j9o7qn0b11n3kzlm
* Merge trunk, fix conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
314
314
        return transformed_future;
315
315
    }
316
316
 
 
317
    /**
 
318
     * Detach the asynchronous operation from this future.
 
319
     *
 
320
     * This decouples the asynchronous operation represented by the NoTLSFuture from the
 
321
     * NoTLSFuture handle itself, similar to std::thread::detach().
 
322
     *
 
323
     * After calling detach() this future is no longer in a valid state; valid() will return
 
324
     * false, and it is no longer possible to wait for or to extract the value of the future.
 
325
     *
 
326
     * This does not change the state of the underlying asynchronous operation. If this
 
327
     * future is the result of a continuation, that continuation will still be run.
 
328
     */
 
329
    void detach()
 
330
    {
 
331
        state = nullptr;
 
332
    }
 
333
 
317
334
private:
318
335
    template<typename Func, typename Result>
319
336
    std::function<void()> make_continuation_for(NoTLSPromise<Result>&& resultant, Func&& continuation);