diff --git a/include/ircd/ctx/future.h b/include/ircd/ctx/future.h index ebed419a7..42ad58832 100644 --- a/include/ircd/ctx/future.h +++ b/include/ircd/ctx/future.h @@ -58,8 +58,6 @@ class ircd::ctx::future T get(); operator T() { return get(); } - void then(decltype(shared_state::callback)); - future(); future(promise &promise); }; @@ -84,8 +82,6 @@ class ircd::ctx::future template future_status wait(const duration &d) const; void wait() const; - void then(decltype(shared_state::callback)); - future(); future(promise &promise); }; @@ -140,21 +136,6 @@ ircd::ctx::future::future(promise &promise) { } -template -void -ircd::ctx::future::then(decltype(shared_state::callback) cb) -{ - assert(valid()); - st->callback = std::move(cb); -} - -inline void -ircd::ctx::future::then(decltype(shared_state::callback) cb) -{ - assert(valid()); - st->callback = std::move(cb); -} - template T ircd::ctx::future::get() diff --git a/include/ircd/ctx/promise.h b/include/ircd/ctx/promise.h index 74f8e5c59..c38ddb2fd 100644 --- a/include/ircd/ctx/promise.h +++ b/include/ircd/ctx/promise.h @@ -147,10 +147,6 @@ ircd::ctx::promise::set_value(T&& val) st->val = std::move(val); st->finished = true; st->cond.notify_all(); - if(st->callback) ircd::post([st(st)] - { - st->callback(st->eptr, st->val); - }); } inline void @@ -160,10 +156,6 @@ ircd::ctx::promise::set_value() assert(!finished()); st->finished = true; st->cond.notify_all(); - if(st->callback) ircd::post([st(st)] - { - st->callback(st->eptr); - }); } template @@ -175,10 +167,6 @@ ircd::ctx::promise::set_value(const T &val) st->val = val; st->finished = true; st->cond.notify_all(); - if(st->callback) ircd::post([st(st)] - { - st->callback(st->eptr, st->val); - }); } inline void @@ -189,10 +177,6 @@ ircd::ctx::promise::set_exception(std::exception_ptr eptr) st->eptr = std::move(eptr); st->finished = true; st->cond.notify_all(); - if(st->callback) ircd::post([st(st)] - { - st->callback(st->eptr); - }); } template @@ -204,8 +188,4 @@ ircd::ctx::promise::set_exception(std::exception_ptr eptr) st->eptr = std::move(eptr); st->finished = true; st->cond.notify_all(); - if(st->callback) ircd::post([st(st)] - { - st->callback(st->eptr, st->val); - }); } diff --git a/include/ircd/ctx/shared_state.h b/include/ircd/ctx/shared_state.h index 58d751cf8..e9d422777 100644 --- a/include/ircd/ctx/shared_state.h +++ b/include/ircd/ctx/shared_state.h @@ -36,7 +36,6 @@ struct ircd::ctx::shared_state using reference_type = T &; T val; - std::function callback; std::shared_ptr> share() const; std::shared_ptr> share(); @@ -49,8 +48,6 @@ struct ircd::ctx::shared_state { using value_type = void; - std::function callback; - std::shared_ptr> share() const; std::shared_ptr> share(); };