3 #define FC_CONTEXT_STACK_SIZE (2048*1024) 36 virtual void busy() = 0;
52 static void cleanup();
58 const string& name()
const;
63 void set_name(
const string& n );
65 const char* current_task_desc()
const;
76 void debug(
const std::string& d );
86 template<
typename Functor>
88 typedef decltype(f()) Result;
89 typedef typename std::remove_const_t< std::remove_reference_t<Functor> > FunctorType;
94 async_task(tsk.get(),prio);
109 template<
typename Functor>
112 typedef decltype(f()) Result;
117 async_task(tsk.get(),prio,when);
143 bool is_running()
const;
144 bool is_current()
const;
149 template<
typename T1,
typename T2>
151 std::vector<fc::promise_base::ptr> proms(2);
180 void yield(
bool reschedule=
true);
188 void notify_task_has_been_canceled();
219 template<
typename T1,
typename T2>
226 template<
typename Functor>
230 template<
typename Functor>
240 template<
typename Functor>
246 typedef decltype(f()) Result;
254 struct _EXCEPTION_POINTERS;
270 typedef int (*unhandled_exception_filter_type)(unsigned, _EXCEPTION_POINTERS*);
271 void set_unhandled_structured_exception_filter(unhandled_exception_filter_type new_filter);
272 unhandled_exception_filter_type get_unhandled_structured_exception_filter();
void sleep_until(const time_point &tp)
void set_task_specific_data(unsigned slot, void *new_value, void(*cleanup)(void *))
auto async(Functor &&f, const char *desc FC_TASK_NAME_DEFAULT_ARG, priority prio=priority()) -> fc::future< decltype(f())>
virtual ~thread_idle_notifier()
a placeholder for the result of an asynchronous operation.
unsigned get_next_unused_task_storage_slot()
void * get_task_specific_data(unsigned slot)
std::shared_ptr< promise_base > ptr
const T & wait(const microseconds &timeout=microseconds::maximum()) const
auto async(Functor &&f, const char *desc FC_TASK_NAME_DEFAULT_ARG, priority prio=priority()) -> fc::future< decltype(f())>
auto schedule(Functor &&f, const fc::time_point &when, const char *desc FC_TASK_NAME_DEFAULT_ARG, priority prio=priority()) -> fc::future< decltype(f())>
auto sync_call(thread *t, Functor &&f, const char *desc FC_TASK_NAME_DEFAULT_ARG, priority prio=priority()) -> decltype(f())
void usleep(const microseconds &u)
std::shared_ptr< task< R, FunctorSize > > ptr
int wait_any(const fc::future< T1 > &f1, const fc::future< T2 > &f2, const microseconds &timeout_us=microseconds::maximum())
static thread & current()
void * get_thread_specific_data(unsigned slot)
#define FC_TASK_NAME_DEFAULT_ARG
int wait_any(const fc::future< T1 > &f1, const fc::future< T2 > &f2, const microseconds timeout_us=microseconds::maximum())
int wait_any_until(std::vector< promise_base::ptr > &&v, const time_point &tp)
static microseconds maximum()
boost::signals2::signal< T > signal
auto schedule(Functor &&f, const fc::time_point &t, const char *desc FC_TASK_NAME_DEFAULT_ARG, priority prio=priority()) -> fc::future< decltype(f())>
void set_thread_specific_data(unsigned slot, void *new_value, void(*cleanup)(void *))