Added retain where applicable
This commit is contained in:
parent
7cf371736b
commit
19bbc4080e
3 changed files with 4 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ namespace fc {
|
||||||
|
|
||||||
void set_exception( const fc::exception_ptr& e );
|
void set_exception( const fc::exception_ptr& e );
|
||||||
|
|
||||||
|
// HERE BE DRAGONS
|
||||||
void retain();
|
void retain();
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ namespace fc {
|
||||||
typedef typename fc::deduce<Functor>::type FunctorType;
|
typedef typename fc::deduce<Functor>::type FunctorType;
|
||||||
typename task<Result,sizeof(FunctorType)>::ptr tsk =
|
typename task<Result,sizeof(FunctorType)>::ptr tsk =
|
||||||
task<Result,sizeof(FunctorType)>::create( fc::forward<Functor>(f), desc );
|
task<Result,sizeof(FunctorType)>::create( fc::forward<Functor>(f), desc );
|
||||||
|
tsk->retain(); // HERE BE DRAFONS
|
||||||
fc::future<Result> r( std::dynamic_pointer_cast< promise<Result> >(tsk) );
|
fc::future<Result> r( std::dynamic_pointer_cast< promise<Result> >(tsk) );
|
||||||
detail::get_worker_pool().post( tsk.get() );
|
detail::get_worker_pool().post( tsk.get() );
|
||||||
return r;
|
return r;
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ namespace fc {
|
||||||
typedef typename fc::deduce<Functor>::type FunctorType;
|
typedef typename fc::deduce<Functor>::type FunctorType;
|
||||||
typename task<Result,sizeof(FunctorType)>::ptr tsk =
|
typename task<Result,sizeof(FunctorType)>::ptr tsk =
|
||||||
task<Result,sizeof(FunctorType)>::create( fc::forward<Functor>(f), desc );
|
task<Result,sizeof(FunctorType)>::create( fc::forward<Functor>(f), desc );
|
||||||
|
tsk->retain(); // HERE BE DRAFONS
|
||||||
fc::future<Result> r( std::dynamic_pointer_cast< promise<Result> >(tsk) );
|
fc::future<Result> r( std::dynamic_pointer_cast< promise<Result> >(tsk) );
|
||||||
async_task(tsk.get(),prio);
|
async_task(tsk.get(),prio);
|
||||||
return r;
|
return r;
|
||||||
|
|
@ -111,6 +112,7 @@ namespace fc {
|
||||||
typedef decltype(f()) Result;
|
typedef decltype(f()) Result;
|
||||||
typename task<Result,sizeof(Functor)>::ptr tsk =
|
typename task<Result,sizeof(Functor)>::ptr tsk =
|
||||||
task<Result,sizeof(Functor)>::create( fc::forward<Functor>(f), desc );
|
task<Result,sizeof(Functor)>::create( fc::forward<Functor>(f), desc );
|
||||||
|
tsk->retain(); // HERE BE DRAFONS
|
||||||
fc::future<Result> r( std::dynamic_pointer_cast< promise<Result> >(tsk) );
|
fc::future<Result> r( std::dynamic_pointer_cast< promise<Result> >(tsk) );
|
||||||
async_task(tsk.get(),prio,when);
|
async_task(tsk.get(),prio,when);
|
||||||
return r;
|
return r;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue