Added constructor for auto-fulfillment
This commit is contained in:
parent
ef3d36547e
commit
9954a3775c
1 changed files with 3 additions and 2 deletions
|
|
@ -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 );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue