From 9954a3775c32ad7fdc5aa5000287a5922d162e24 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Mon, 1 Oct 2018 17:31:04 +0200 Subject: [PATCH] Added constructor for auto-fulfillment --- include/fc/thread/future.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp index cc2c317..0d0e2e7 100644 --- a/include/fc/thread/future.hpp +++ b/include/fc/thread/future.hpp @@ -21,7 +21,6 @@ #endif namespace fc { - class abstract_thread; struct void_t{}; class priority; class thread; @@ -146,7 +145,9 @@ namespace fc { public: typedef fc::shared_ptr< promise > ptr; promise( const char* desc FC_TASK_NAME_DEFAULT_ARG):promise_base(desc){} - //promise( const void_t& ){ set_value(); } + promise( bool fulfilled, const char* desc FC_TASK_NAME_DEFAULT_ARG ){ + if( fulfilled ) set_value(); + } void wait(const microseconds& timeout = microseconds::maximum() ){ this->_wait( timeout );