28 #pragma pack(push,_CRT_PACKING)
29 #pragma warning(push,3)
30 #pragma push_macro("new")
69 _THROW_NCEE(::std::runtime_error,
"Fail to schedule the chore!");
82 static ::std::shared_ptr<scheduler_interface> _S_scheduler;
124 #ifndef _REPORT_PPLTASK_UNOBSERVED_EXCEPTION
125 #define _REPORT_PPLTASK_UNOBSERVED_EXCEPTION() do { \
126 ReportUnhandledError(); \
128 ::Concurrency::details::_ReportUnobservedException(); \
137 virtual void invoke()
const = 0;
161 _ASSERTE(_NewState != _New);
162 std::lock_guard<std::mutex> _Lock(_M_Cs);
163 if (_M_State < _NewState)
165 _M_State = _NewState;
168 _M_StateChanged.notify_all();
173 std::unique_lock<std::mutex> _Lock(_M_Cs);
175 while(_M_State < _State)
177 _M_StateChanged.wait(_Lock);
185 : _M_pScheduler(_PScheduler), _M_State(_New)
193 _TaskProcHandle_t::_RunChoreBridge(_Parameter);
199 _M_pScheduler->schedule(_TaskProcHandle_t::_RunChoreBridge, _Parameter);
231 return _M_pScheduler;
247 _Ptr->schedule(_Proc, _Parameter);
275 #pragma pop_macro("new")
_TaskCollectionBaseImpl _TaskCollection_t
Definition: pplwin.h:262
static void __cdecl _Callback(void *_Args)
Definition: pplwin.h:48
_TaskCollectionState _M_State
Definition: pplwin.h:259
_TaskInliningMode _TaskInliningMode_t
Definition: pplwin.h:267
_TaskCollectionBaseImpl(::Concurrency::scheduler_ptr _PScheduler)
Definition: pplwin.h:184
void * _M_param
Definition: pplwin.h:46
_CRTIMP2 void __cdecl _Release_chore(_Threadpool_chore *)
_Threadpool_chore _M_Chore
Definition: pplwin.h:44
Definition: concrt.h:4304
Definition: pplinterface.h:228
const ::std::shared_ptr< scheduler_interface > & get_ambient_scheduler()
Definition: pplwin.h:88
void _RunAndWait()
Definition: pplwin.h:213
void _SetCollectionState(_TaskCollectionState _NewState)
Definition: pplwin.h:159
_TaskProcHandle()
Definition: pplwin.h:135
inline::std::shared_ptr< scheduler_interface > & _GetStaticAmbientSchedulerRef()
Definition: pplwin.h:80
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:43
Definition: concrt.h:4172
virtual void schedule(TaskProc_t _Proc, void *_Param) override
Definition: pplwin.h:74
_CRTIMP2 int __cdecl _Schedule_chore(_Threadpool_chore *)
_CRTIMP2 void __cdecl _ReportUnobservedException()
Definition: ppltaskscheduler.h:26
void set_ambient_scheduler(const ::std::shared_ptr< scheduler_interface > &_Scheduler)
Definition: pplwin.h:93
_TaskInliningMode
The enum defines inlining scheduling policy for ppltasks. Scheduling a chore or a functor with _TaskI...
Definition: pplinterface.h:221
_PPLTaskChore(TaskProc_t _Proc, void *_Param)
Definition: pplwin.h:60
#define _THROW_NCEE(x, y)
Definition: xstddef:78
_TaskProcHandle _TaskProcHandle_t
Definition: pplwin.h:182
~_PPLTaskChore()
Definition: pplwin.h:55
void _Schedule()
Definition: pplwin.h:64
void _Complete()
Definition: pplwin.h:223
::Concurrency::scheduler_ptr _GetScheduler() const
Definition: pplwin.h:229
Represents a pointer to a scheduler. This class exists to allow the the specification of a shared lif...
Definition: pplinterface.h:47
_Task_generator_oversubscriber _Task_generator_oversubscriber_t
Definition: pplwin.h:268
void(__cdecl * TaskProc_t)(void *)
An elementary abstraction for a task, defined as void (__cdecl * TaskProc_t)(void *)...
Definition: pplinterface.h:32
virtual void invoke() const =0
TaskProc_t _M_proc
Definition: pplwin.h:45
void _ScheduleTask(_TaskProcHandle_t *_Parameter, _TaskInliningMode _InliningMode)
Definition: pplwin.h:189
::std::mutex _M_Cs
Definition: pplwin.h:257
::std::condition_variable _M_StateChanged
Definition: pplwin.h:256
#define _CRTIMP2
Definition: crtdefs.h:36
void _Cancel()
Definition: pplwin.h:208
void WaitUntilStateChangedTo(_TaskCollectionState _State)
Definition: pplwin.h:171
static void _RunTask(TaskProc_t _Proc, void *_Parameter, _TaskInliningMode _InliningMode)
Definition: pplwin.h:235
virtual ~_TaskProcHandle()
Definition: pplwin.h:136
::Concurrency::scheduler_ptr _M_pScheduler
Definition: pplwin.h:258
void _Wait()
Definition: pplwin.h:218
void operator()() const
Definition: pplwin.h:139
static void __cdecl _RunChoreBridge(void *_Parameter)
Definition: pplwin.h:144
_TaskCollectionState
Definition: pplwin.h:153