| 213 | */ |
| 214 | template<typename Functor> |
| 215 | auto sync_call( thread* t, Functor&& f, const char* desc FC_TASK_NAME_DEFAULT_ARG, priority prio = priority()) -> decltype(f()) |
| 216 | { |
| 217 | if( t == nullptr ) |
| 218 | return f(); |
| 219 | |
| 220 | typedef decltype(f()) Result; |
| 221 | future<Result> r = t->async( f, desc, prio ); |
| 222 | return r.wait(); |
| 223 | } |
| 224 | |
| 225 | } // end namespace fc |
| 226 |