通过增加promise_finish函数,实现future的cancel。

This commit is contained in:
zhengchao
2018-11-23 20:15:01 +08:00
parent 6cd2b8186b
commit 5d20a52552
3 changed files with 54 additions and 10 deletions

View File

@@ -31,6 +31,9 @@ void future_destroy(struct future * f);
struct promise * future_to_promise(struct future * f);
void promise_failed(struct promise * p, enum e_future_error error, const char * what);
void promise_success(struct promise * p, void * result);
void promise_finish(struct promise * p);
void promise_allow_many_successes(struct promise *p);
void promise_set_ctx(struct promise * p, void * ctx, promise_ctx_destroy_cb * cb);
void * promise_get_ctx(struct promise * p);
void * promise_dettach_ctx(struct promise * p);