Added constructor for auto-fulfillment

This commit is contained in:
Peter Conrad 2018-10-01 17:31:04 +02:00
parent ef3d36547e
commit 9954a3775c

View file

@ -21,7 +21,6 @@
#endif #endif
namespace fc { namespace fc {
class abstract_thread;
struct void_t{}; struct void_t{};
class priority; class priority;
class thread; class thread;
@ -146,7 +145,9 @@ namespace fc {
public: public:
typedef fc::shared_ptr< promise<void> > ptr; typedef fc::shared_ptr< promise<void> > ptr;
promise( const char* desc FC_TASK_NAME_DEFAULT_ARG):promise_base(desc){} 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() ){ void wait(const microseconds& timeout = microseconds::maximum() ){
this->_wait( timeout ); this->_wait( timeout );