21 #if defined(BUILD_WINDOWS)
22 #error Must not be included during CRT build with _CRT_WINDOWS flag enabled
25 #if !(defined (_M_X64) || defined (_M_IX86) || defined (_M_ARM) || defined (_M_ARM64))
26 #error ERROR: Concurrency Runtime is supported only on X64, X86, ARM, and ARM64 architectures.
30 #error ERROR: Concurrency Runtime is not supported when compiling /clr.
34 #error ERROR: Concurrency Runtime is supported only for C++.
49 #pragma pack(push,_CRT_PACKING)
50 #pragma push_macro("new")
55 struct _SECURITY_ATTRIBUTES;
58 struct _GROUP_AFFINITY;
64 #ifndef _HRESULT_DEFINED
65 #define _HRESULT_DEFINED
74 #pragma push_macro("_YieldProcessor")
75 #undef _YieldProcessor
77 #if (defined (_M_IX86) || defined (_M_X64))
78 #define _YieldProcessor _mm_pause
83 #if (defined (_M_IX86) || defined (_M_ARM))
85 #define _InterlockedIncrementSizeT(_Target) static_cast<size_t>(_InterlockedIncrement(reinterpret_cast<long volatile *>(_Target)))
86 #define _InterlockedDecrementSizeT(_Target) static_cast<size_t>(_InterlockedDecrement(reinterpret_cast<long volatile *>(_Target)))
87 #define _InterlockedCompareExchangeSizeT(_Target, _Exchange, _Comparand) static_cast<size_t>(_InterlockedCompareExchange( \
88 reinterpret_cast<long volatile *>(_Target), \
89 static_cast<long>(_Exchange), \
90 static_cast<long>(_Comparand)))
96 #define _InterlockedIncrementSizeT(_Target) static_cast<size_t>(_InterlockedIncrement64(reinterpret_cast<__int64 volatile *>(_Target)))
97 #define _InterlockedDecrementSizeT(_Target) static_cast<size_t>(_InterlockedDecrement64(reinterpret_cast<__int64 volatile *>(_Target)))
98 #define _InterlockedCompareExchangeSizeT(_Target, _Exchange, _Comparand) static_cast<size_t>(_InterlockedCompareExchange64( \
99 reinterpret_cast<__int64 volatile *>(_Target), \
100 static_cast<__int64>(_Exchange), \
101 static_cast<__int64>(_Comparand)))
118 #define _CONCRT_ASSERT(x) __pragma (warning (suppress: 4127)) do {_ASSERTE(x); __assume(x);} while(false)
120 #define _CONCRT_ASSERT(x) do {_ASSERTE(x); __assume(x);} while(false)
123 #define _CONCRT_ASSERT(x) __assume(x)
130 #define _LISTENTRY_SIZE ((2 * sizeof(void *) + sizeof(_CONCRT_BUFFER) - 1) / sizeof(_CONCRT_BUFFER))
131 #define _SAFERWLIST_SIZE ((3 * sizeof(void *) + 2 * sizeof(long) + sizeof(_CONCRT_BUFFER) - 1) / sizeof(_CONCRT_BUFFER))
194 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
218 _CONCRTIMP void __cdecl set_task_execution_resources(DWORD_PTR _ProcessAffinityMask);
266 class _TaskCollectionBase;
288 void operator delete(
void * _Ptr)
throw()
294 void *
operator new(
size_t _Size,
const std::nothrow_t&)
throw()
311 void operator delete(
void * _Ptr,
const std::nothrow_t&)
throw()
313 operator delete(_Ptr);
319 return operator new(
_Size);
323 void operator delete[](
void * _Ptr)
throw()
325 operator delete(_Ptr);
329 void *
operator new[](
size_t _Size,
const std::nothrow_t& _No_throw)
throw ()
331 return operator new(
_Size, _No_throw);
335 void operator delete[](
void * _Ptr,
const std::nothrow_t& _No_throw)
throw()
337 operator delete(_Ptr, _No_throw);
341 void *
operator new(
size_t,
void * _Location)
throw()
347 void operator delete(
void *,
void *)
throw()
352 void * __cdecl
operator new[](
size_t,
void * _Location)
throw()
358 void __cdecl
operator delete[](
void *,
void *)
throw()
400 template <
size_t _Size>
405 template <
typename _Ty>
412 template <
typename _Ty>
419 template <
typename _Ty>
424 template <
typename _Ty>
426 return (_Ty)_InterlockedExchangeAdd((
volatile long*)&_Location, (
long)_Addend);
429 template <
typename _Ty>
434 template <
typename _Ty>
442 struct _Subatomic_impl<8> {
443 template <
typename _Ty>
444 static void _StoreWithRelease(
volatile _Ty& _Location, _Ty _Rhs) {
449 template <
typename _Ty>
450 static _Ty _LoadWithAquire(
volatile _Ty& _Location) {
455 template <
typename _Ty>
456 static _Ty _CompareAndSwap(
volatile _Ty& _Location, _Ty _NewValue, _Ty _Comperand) {
457 return (_Ty)_InterlockedCompareExchange64((
volatile __int64*)&_Location, (__int64)_NewValue, (__int64)_Comperand);
460 template <
typename _Ty>
461 static _Ty _FetchAndAdd(
volatile _Ty& _Location, _Ty _Addend) {
462 return (_Ty)_InterlockedExchangeAdd64((
volatile __int64*)&_Location, (__int64)_Addend);
465 template <
typename _Ty>
466 static _Ty _Increment(
volatile _Ty& _Location) {
467 return (_Ty)_InterlockedIncrement64((
volatile __int64*)&_Location);
470 template <
typename _Ty>
471 static _Ty _Decrement(
volatile _Ty& _Location) {
472 return (_Ty)_InterlockedDecrement64((
volatile __int64*)&_Location);
482 template <
typename _Ty>
488 operator _Ty()
const volatile {
577 template<
unsigned int _YieldCount = 1>
582 typedef void (__cdecl *_YieldFunction)();
589 : _M_yieldFunction(_YieldMethod), _M_state(_StateInitial)
604 _M_state = _StateSingle;
609 _M_currentYield = _YieldCount;
610 _M_state = _StateSpin;
632 unsigned long _Count = _NumberOfSpins();
634 for (
unsigned long _I = 0; _I <
_Count; _I++)
639 if (!_ShouldSpinAgain())
641 _M_state = (_M_currentYield == 0) ? _StateBlock : _StateYield;
649 if (--_M_currentYield == 0)
651 _M_state = _StateBlock;
699 #pragma warning ( push )
700 #pragma warning ( disable : 6326 ) // potential comparison of a constant with another constant
701 bool _ShouldYield = (_YieldCount != 0);
702 #pragma warning ( pop )
720 _M_state = _StateInitial;
750 return (--_M_currentSpin > 0);
1033 static void __cdecl
_WaitEquals(
volatile const long& _Location,
long _Value,
long _Mask = 0xFFFFFFFF);
1043 template<
typename _ElemType>
1064 if (_MallocaRet ==
nullptr)
1065 throw std::bad_alloc();
1066 _Initialize(static_cast<_ElemType *>(_MallocaRet));
1067 return static_cast<_ElemType *
>(_MallocaRet);
1099 template<
typename _ElemType>
1126 if (_MallocaRet ==
nullptr)
1127 throw std::bad_alloc();
1128 _AddNode(static_cast<_ElemType *>(_MallocaRet));
1129 return static_cast<_ElemType *
>(_MallocaRet);
1137 auto _M_Next = _Node->_M_Next;
1138 _Node->_M_Elem._ElemType::~_ElemType();
1854 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
2023 template<
typename _Ty>
2082 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
2121 virtual unsigned int Id()
const =0;
2140 virtual unsigned int Reference() =0;
2161 virtual unsigned int Release() =0;
2170 virtual ~ScheduleGroup() {};
2179 const unsigned int MaxExecutionResources = 0xFFFFFFFF;
2187 const unsigned int INHERIT_THREAD_PRIORITY = 0x0000F000;
2198 enum PolicyElementKey
2241 TargetOversubscriptionFactor,
2252 LocalContextCacheSize,
2290 DynamicProgressFeedback,
2300 WinRTInitialization,
2330 UmsThreadDefault = ThreadScheduler
2333 #pragma deprecated(UmsThreadDefault)
2342 enum SchedulingProtocolType
2350 EnhanceScheduleGroupLocality,
2357 EnhanceForwardProgress
2368 enum DynamicProgressFeedbackType
2377 ProgressFeedbackDisabled,
2386 ProgressFeedbackEnabled
2396 enum WinRTInitializationType
2403 InitializeWinRTAsMTA,
2410 DoNotInitializeWinRT
2426 class SchedulerPolicy
2473 _CONCRTIMP SchedulerPolicy(
size_t _PolicyKeyCount, ...);
2497 _CONCRTIMP SchedulerPolicy(
const SchedulerPolicy& _SrcPolicy);
2516 _CONCRTIMP SchedulerPolicy& operator=(
const SchedulerPolicy& _RhsPolicy);
2540 _CONCRTIMP unsigned int GetPolicyValue(PolicyElementKey _Key)
const;
2566 _CONCRTIMP unsigned int SetPolicyValue(PolicyElementKey _Key,
unsigned int _Value);
2587 _CONCRTIMP void SetConcurrencyLimits(
unsigned int _MinConcurrency,
unsigned int _MaxConcurrency = MaxExecutionResources);
2598 void _ValidateConcRTPolicy()
const;
2606 unsigned int _M_pPolicyBag[MaxPolicyElementKey];
2609 SchedulerType _M_schedulerKind;
2610 unsigned int _M_maxConcurrency;
2611 unsigned int _M_minConcurrency;
2612 unsigned int _M_targetOversubscriptionFactor;
2613 unsigned int _M_localContextCacheSize;
2614 unsigned int _M_contextStackSize;
2615 unsigned int _M_contextPriority;
2616 SchedulingProtocolType _M_schedulingProtocol;
2617 DynamicProgressFeedbackType _M_dynamicProgressFeedback;
2618 WinRTInitializationType _M_WinRTInitialization;
2619 } _M_specificValues;
2627 void _Initialize(
size_t _PolicyKeyCount,
va_list * _PArgs);
2633 void _Assign(
const SchedulerPolicy& _SrcPolicy);
2639 static bool __cdecl _ValidPolicyKey(PolicyElementKey _Key);
2645 static bool __cdecl _ValidPolicyValue(PolicyElementKey _Key,
unsigned int _Value);
2651 static bool __cdecl _AreConcurrencyLimitsValid(
unsigned int _MinConcurrency,
unsigned int _MaxConcurrency);
2652 bool _AreConcurrencyLimitsValid()
const;
2658 bool _ArePolicyCombinationsValid()
const;
2664 void _ResolvePolicyValues();
2670 static char * __cdecl _StringFromPolicyKey(
unsigned int _Index);
2685 class CurrentScheduler
2688 CurrentScheduler() {}
2715 _CONCRTIMP static SchedulerPolicy __cdecl GetPolicy();
2744 _CONCRTIMP static unsigned int __cdecl GetNumberOfVirtualProcessors();
2769 _CONCRTIMP static void __cdecl Create(
const SchedulerPolicy& _Policy);
2804 _CONCRTIMP static void __cdecl RegisterShutdownEvent(HANDLE _ShutdownEvent);
2827 _CONCRTIMP static ScheduleGroup * __cdecl CreateScheduleGroup();
2853 _CONCRTIMP static ScheduleGroup * __cdecl CreateScheduleGroup(location& _Placement);
2917 _CONCRTIMP static bool __cdecl IsAvailableLocation(
const location& _Placement);
2958 virtual ~Scheduler() {}
2986 _CONCRTIMP static Scheduler * __cdecl Create(
const SchedulerPolicy& _Policy);
2995 virtual unsigned int Id()
const =0;
3006 virtual unsigned int GetNumberOfVirtualProcessors()
const =0;
3019 virtual SchedulerPolicy GetPolicy()
const =0;
3036 virtual unsigned int Reference() =0 ;
3051 virtual unsigned int Release() =0;
3062 virtual void RegisterShutdownEvent(HANDLE _Event) =0;
3080 virtual void Attach() =0;
3100 _CONCRTIMP static void __cdecl SetDefaultSchedulerPolicy(
const SchedulerPolicy& _Policy);
3114 _CONCRTIMP static void __cdecl ResetDefaultSchedulerPolicy();
3134 virtual ScheduleGroup * CreateScheduleGroup() =0;
3157 virtual ScheduleGroup * CreateScheduleGroup(location& _Placement) =0;
3192 virtual void ScheduleTask(
TaskProc _Proc,
_Inout_opt_ void * _Data, location& _Placement) =0;
3209 virtual bool IsAvailableLocation(
const location& _Placement)
const =0;
3239 virtual unsigned int GetId()
const =0;
3254 virtual unsigned int GetVirtualProcessorId()
const =0;
3269 virtual unsigned int GetScheduleGroupId()
const =0;
3294 _CONCRTIMP static unsigned int __cdecl VirtualProcessorId();
3305 _CONCRTIMP static unsigned int __cdecl ScheduleGroupId();
3351 virtual void Unblock() =0;
3369 virtual bool IsSynchronouslyBlocked()
const =0;
3407 static inline void __cdecl YieldExecution()
3423 _CONCRTIMP static bool __cdecl IsCurrentTaskCollectionCanceling();
3436 _CONCRTIMP static Context * __cdecl CurrentContext();
3448 _CONCRTIMP static void __cdecl Oversubscribe(
bool _BeginOversubscription);
3457 virtual ~Context() {};
3595 bool _Acquire_lock(
void * _PLockingNode,
bool _FHasExternalNode);
3768 void _Acquire_lock(
void * _PLockingNode,
bool _FHasExternalNode);
3831 scoped_lock_read
const &
operator=(
const scoped_lock_read&);
4020 event(
const event& _Event);
4097 _NonReentrantPPLLock&
operator=(
const _NonReentrantPPLLock&) =
delete;
4112 _Scoped_lock&
operator=(
const _Scoped_lock&) =
delete;
4135 _ReentrantPPLLock&
operator=(
const _ReentrantPPLLock&) =
delete;
4238 template <
typename _ChoreType,
typename _Function>
4242 _ChoreType *
_Chore =
new _ChoreType(_Func);
4243 _Chore->_M_fRuntimeOwnsLifetime =
true;
4252 template <
typename _ChoreType>
4255 auto _PChore =
static_cast<_ChoreType *
>(_PContext);
4314 _M_pTokenState(
NULL),
4315 _M_completedStolenChores(_CollectionNotInitialized),
4316 _M_unpoppedChores(0),
4317 _M_pException(
NULL),
4318 _M_inliningDepth(_S_notInlined)
4325 _M_pTokenState(_PTokenState),
4326 _M_completedStolenChores(_CollectionNotInitialized),
4327 _M_unpoppedChores(0),
4328 _M_pException(
NULL),
4329 _M_inliningDepth(_S_notInlined)
4338 return _M_pOwningContext;
4344 return _M_inliningDepth;
4350 return (_M_inliningDepth != _S_notInlined);
4356 return (_M_inlineFlags & _S_structured) != 0;
4364 friend class ::Concurrency::details::_UnrealizedChore;
4365 friend class ::Concurrency::details::ContextBase;
4371 _CollectionInitialized = 0
4377 return (std::exception_ptr *) ((
size_t)_M_pException & ~_S_cancelBitsMask);
4383 return _M_pException !=
NULL;
4389 return (
size_t) _M_pException & _S_cancelBitsMask;
4395 return (_CancelState() & _S_cancelBitsMask) != 0;
4402 return _CancelState() == _S_cancelShotdownOwner;
4408 return _CancelState() == _S_cancelDeferredShootdownOwner;
4414 return ((_M_inliningDepth != _S_notInlined) ? _M_pParent :
NULL);
4418 bool _WillInterruptForPendingCancel();
4422 void _RaisedException();
4426 void _RethrowException();
4429 bool _MarkCancellation();
4433 void _FinishCancelState(
size_t _NewCancelState);
4438 void _RaisedCancel();
4445 int _M_inliningDepth : 28;
4446 int _M_inlineFlags : 4;
4471 static const size_t _S_cancelBitsMask = 0x3;
4472 static const size_t _S_cancelNone = 0x0;
4473 static const size_t _S_cancelStarted = 0x1;
4474 static const size_t _S_cancelDeferredShootdownOwner = 0x2;
4475 static const size_t _S_cancelShotdownOwner = 0x3;
4478 static const size_t _S_nonNull = 0x8;
4479 static const size_t _S_cancelException = 0xC;
4482 static const int _S_notInlined = -1;
4485 static const int _S_structured = 0x00000001;
4486 static const int _S_localCancel = 0x00000002;
4487 static const int _S_reserved = 0x0000000C;
4506 _M_pTokenState =
NULL;
4606 return _RunAndWait();
4613 void _CancelStolenContexts();
4621 _M_pOwningContext =
NULL;
4622 _M_inlineFlags = _S_structured;
4647 if (_M_unpoppedChores > 0)
4651 if (!__uncaught_exception())
4673 void _WaitOnStolenChores(
long _StolenChoreCount);
4692 _CONCRT_BUFFER _M_event[(
sizeof(
void*) +
sizeof(_CONCRT_BUFFER) - 1) /
sizeof(_CONCRT_BUFFER)];
4713 _TaskCollection& operator=(
const _TaskCollection&) =
delete;
4811 return _RunAndWait();
4818 bool _IsMarkedForAbnormalExit()
const;
4824 _TaskCollection * _OriginalCollection()
const;
4830 bool _IsAlias()
const;
4842 void _RegisterCompletionHandler(
TaskProc _Func,
void * _PCompletionContext);
4847 friend class ::Concurrency::details::ContextBase;
4854 bool _IsStaleAlias()
const;
4860 void _ReleaseAlias();
4872 _TaskCollection(_TaskCollection * _POriginCollection,
bool _FDirectAlias);
4878 _TaskCollection * _Alias();
4887 void _Abort(
bool _FLeaveCanceled =
false);
4893 bool _IsIndirectAlias()
const;
4899 bool _IsDirectAlias()
const;
4905 bool _HasDirectAlias()
const;
4918 void _Cancel(
bool _InsideException, _TaskCollection * _PSnapPoint);
4924 void _NotifyNewChore();
4942 void _FullAliasWait(_TaskCollection * _PSnapPoint);
4951 void _Reset(_TaskCollection * _PSnapPoint);
4959 void _RaisedException();
4967 void _RaisedCancel();
4979 bool _SetCancelState(
long _Status);
4989 void _CancelFromArbitraryThread(
bool _InsideException);
5002 void _CancelDirectAliases(
bool _InsideException, _TaskCollection * _PSnapPoint);
5017 void _CancelStolenContexts(
bool _InsideException,
bool _FInlineGated);
5023 void *_GetStealTrackingList()
const;
5038 void _AbortiveSweep(
void *_PCtx);
5053 static bool __cdecl _CollectionMatchPredicate(
_UnrealizedChore *_PChore,
void *_PData);
5068 static bool __cdecl _SweepAbortedChore(
_UnrealizedChore *_PChore,
void *_PData);
5077 bool _TaskCleanup(
bool _FExceptional);
5122 int _M_taskCookies[2];
5160 return _Depth <= static_cast<size_t>(_InliningMode);
5170 _CONCRTIMP static size_t & __cdecl _GetCurrentInlineDepth();
5218 _M_taskCollection._Schedule(_PChore);
5226 return _M_taskCollection._RunAndWait(_PChore);
5230 _M_taskCollection._Schedule(_PChore);
5241 _M_taskCollection._Cancel();
5261 return _M_taskCollection._RunAndWait();
5266 void _NotificationHandler();
5274 static
void __cdecl _CompletionHandler(
void * _PCompletionContext);
5309 return (_M_pRef->_M_signals != 0);
5360 friend class _TimerStub;
5363 virtual void _Fire() =0;
5386 EnableFlags = _Flags;
5387 EnableLevel = _Level;
5389 #pragma warning ( push )
5390 #pragma warning ( disable : 5393 ) // unreachable code
5396 #pragma warning ( pop )
5398 bool _IsEnabled(
unsigned char _Level,
unsigned long _Flags)
const
5400 return ((_Level <= EnableLevel) && ((EnableFlags & _Flags) == _Flags));
5433 __declspec(deprecated(
"Concurrency::EnableTracing is a deprecated function."))
_CONCRTIMP HRESULT __cdecl EnableTracing();
5718 #ifndef _NO_DEFAULT_CONCRT_LIB
5726 #define _DEBUG_AFFIX "d"
5727 #define _IDL_DEFAULT 2
5729 #define _DEBUG_AFFIX ""
5730 #define _IDL_DEFAULT 0
5733 #if defined(_DLL) && !defined(_STATIC_CPPLIB)
5734 #define _LIB_STEM "concrt"
5736 #define _LIB_STEM "libconcrt"
5737 #if _ITERATOR_DEBUG_LEVEL != _IDL_DEFAULT
5738 #define _IDL_AFFIX _CRT_STRINGIZE(_ITERATOR_DEBUG_LEVEL)
5743 #define _IDL_AFFIX ""
5746 #pragma comment(lib, _LIB_STEM _DEBUG_AFFIX _IDL_AFFIX)
5757 #pragma pop_macro("_YieldProcessor")
5758 #pragma pop_macro("new")
_CONCRTIMP void _Release()
friend class _TaskCollection
Definition: concrt.h:4265
DWORD _M_boundQueueId
Definition: concrt.h:5127
_Scoped_lock const & operator=(const _Scoped_lock &)
void operator=(const _SpinLock &)
_CONCRTIMP const GUID VirtualProcessorEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to v...
A cancellation beacon is a flag which can be polled in an inlinable fashion using the is_signaled met...
Definition: concrt.h:5299
This class describes an exception thrown when the link_target method of a messaging block is called a...
Definition: concrt.h:1570
std::exception_ptr * _Exception() const
Definition: concrt.h:4375
int _InliningDepth() const
Definition: concrt.h:4342
_CONCRTIMP void __cdecl wait(unsigned int _Milliseconds)
Pauses the current context for a specified amount of time.
void _Raise()
Definition: concrt.h:5316
_CONCRTIMP scheduler_resource_allocation_error(_In_z_ const char *_Message, HRESULT _Hresult)
Constructs a scheduler_resource_allocation_error object.
void _PrepareStealStructured(ContextBase *_PContext)
void _Assign(const location &_Rhs)
Assigns _Rhs to this location.
Definition: concrt.h:1999
_CONCRTIMP const GUID ContextEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to c...
void * _M_pReaderHead
Definition: concrt.h:3897
void _AddNode(_ElemType *_Elem)
Definition: concrt.h:1114
bool _ShouldInline(_TaskInliningMode _InliningMode) const
Definition: concrt.h:5156
~_Scoped_lock()
Definition: concrt.h:901
Definition: functional:67
long _Reference()
Definition: concrt.h:4042
This class describes an exception thrown when an attempt is made to set the concurrency limits of a S...
Definition: concrt.h:1655
Definition: concrt.h:1100
_ReaderWriterLock & _M_lock
Definition: concrt.h:1005
#define NULL
Definition: vcruntime.h:236
_YieldFunction _M_yieldFunction
Definition: concrt.h:756
Agents_EventType
The types of events that can be traced using the tracing functionality offered by the Agents Library ...
Definition: concrt.h:5643
_CONCRTIMP bool _TryAcquire()
_SpinWait(_YieldFunction _YieldMethod=_UnderlyingYield)
Construct a spin wait object
Definition: concrt.h:588
static _CONCRTIMP void __cdecl _Yield()
An event type used for miscellaneous events.
Definition: concrt.h:5455
static void __cdecl _Initialize()
Definition: concrt.h:1020
Indicates that the location represents a particular NUMA node.
Definition: concrt.h:1950
An event type that marks the beginning of a start/end event pair.
Definition: concrt.h:5465
size_t _M_ElemsConstructed
Definition: concrt.h:1089
_NonReentrantPPLLock & _M_lock
Definition: concrt.h:4118
_CONCRTIMP bool try_lock_for(unsigned int _Timeout)
Tries to acquire the lock without blocking for a specific number of milliseconds. ...
_CONCRTIMP ~scoped_lock_read()
Destroys a scoped_lock_read object and releases the lock supplied in its constructor.
_CONCRTIMP event()
Constructs a new event.
critical_section & native_handle_type
A reference to a critical_section object.
Definition: concrt.h:3557
Structured task collections represent groups of work which follow a strictly LIFO ordered paradigm qu...
Definition: concrt.h:4495
void * _M_pOwningContext
Definition: concrt.h:4452
Async Task collections is a thin wrapper over task collection to cater to the execution of asynchrono...
Definition: concrt.h:5178
This class describes an exception thrown when a lock is acquired improperly.
Definition: concrt.h:1801
long _M_activeStealersForCancellation
A count of active stealers for CANCELLATION PURPOSES ONLY. This is non-interlocked and guarded by the...
Definition: concrt.h:5097
::Concurrency::critical_section _M_criticalSection
Definition: concrt.h:4163
An event type that represents the linking of message blocks
Definition: concrt.h:5679
This class describes an exception thrown when an invalid or unknown key is passed to a SchedulerPolic...
Definition: concrt.h:1599
static _Ty _LoadWithAquire(volatile _Ty &_Location)
Definition: concrt.h:413
void _Construct()
Definition: concrt.h:4619
unsigned int _Count
Definition: xcomplex:668
An event type that represents the unlinking of message blocks
Definition: concrt.h:5685
static _CONCRTIMP void __cdecl _ScheduleTask(TaskProc _Proc, void *_Data)
volatile long _M_owner
Definition: concrt.h:4169
An event type that represents the act of a attaching to a scheduler.
Definition: concrt.h:5490
_CONCRTIMP void _Acquire(void *_Lock_node)
void _DisableTrace()
Definition: concrt.h:5391
bool _IsEnabled(unsigned char _Level, unsigned long _Flags) const
Definition: concrt.h:5398
Implements busy wait with no backoff
Definition: concrt.h:578
bool operator!=(const location &_Rhs) const
Determines whether two location objects represent different location.
Definition: concrt.h:1919
TaskProc m_pFunction
Definition: concrt.h:4191
#define _CONCRT_ASSERT(x)
Definition: concrt.h:123
Definition: concrt.h:4304
_CONCRTIMP void __cdecl _Trace_ppl_function(const GUID &_Guid, unsigned char _Level, ConcRT_EventType _Type)
_TaskCollectionBase * _M_pParent
Definition: concrt.h:4442
_Ty _FetchAndAdd(_Ty _Addend)
Definition: concrt.h:501
_TaskCollectionBase(_CancellationTokenState *_PTokenState)
Definition: concrt.h:4324
_CONCRTIMP void _Release()
Definition: concrt.h:4128
bool _IsMarkedForCancellation() const
Definition: concrt.h:4393
unsigned int _M_ms
Definition: concrt.h:5369
_CONCRTIMP unsigned int _Release()
Definition: concrt.h:4031
_CONCRTIMP void _Release()
_CONCRTIMP void lock()
Acquires the reader-writer lock as a writer.
_CONCRTIMP scoped_lock_read(reader_writer_lock &_Reader_writer_lock)
Constructs a scoped_lock_read object and acquires the reader_writer_lock object passed in the _Reader...
_UnrealizedChore()
Definition: concrt.h:4201
Indicates that the location represents a particular scheduling node.
Definition: concrt.h:1955
This class describes an exception thrown when the Reference method is called on a Scheduler object th...
Definition: concrt.h:1370
_Ty operator=(_Ty _Rhs)
Definition: concrt.h:492
Definition: concrt.h:5633
void(__cdecl * CHOREFUNC)(_UnrealizedChore *_PChore)
Definition: concrt.h:4266
void *volatile _M_pHead
Definition: concrt.h:3645
bool _HasWriteLock() const
Definition: concrt.h:955
_CONCRTIMP ~_Scoped_lock()
_CONCRTIMP _ReentrantPPLLock()
_CONCRTIMP const GUID PPLParallelForEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to u...
volatile long & _M_flag
Definition: concrt.h:532
static void __cdecl _WaitEquals(volatile const long &_Location, long _Value, long _Mask=0xFFFFFFFF)
void _Unlock_reader()
Called from unlock() when a reader is holding the lock. Reader count is decremented and if this is th...
_CONCRTIMP scoped_lock(reader_writer_lock &_Reader_writer_lock)
Constructs a scoped_lock object and acquires the reader_writer_lock object passed in the _Reader_writ...
_TaskCollectionStatus _RunAndWait()
A cancellation friendly wrapper with which to execute _PChore and then waits for all chores running i...
Definition: concrt.h:5257
CHOREFUNC _M_pChoreFunction
Definition: concrt.h:4272
This class describes an exception thrown when calls to the Block and Unblock methods of a Context obj...
Definition: concrt.h:1429
This class describes an exception thrown when a messaging block is given a pointer to a target which ...
Definition: concrt.h:1520
void(__cdecl * TaskProc)(void *)
Concurrency::details contains definitions of support routines in the public namespaces and one or mor...
Definition: concrt.h:251
_CONCRT_BUFFER _M_criticalSection[(4 *sizeof(void *)+2 *sizeof(long)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:812
scoped_lock const & operator=(const scoped_lock &)
size_t _CancelState() const
Definition: concrt.h:4387
An event type that represents the creation of an object
Definition: concrt.h:5649
virtual ~_RefCounterBase()
Definition: concrt.h:4035
RAII wrapper used to maintain and limit ppltask maximum inline schedule depth. This class will keep a...
Definition: concrt.h:5138
long _M_unpoppedChores
Definition: concrt.h:4456
_CONCRTIMP scheduler_worker_creation_error(_In_z_ const char *_Message, HRESULT _Hresult)
Constructs a scheduler_worker_creation_error object.
ConcRT_EventType
The types of events that can be traced using the tracing functionality offered by the Concurrency Run...
Definition: concrt.h:5449
void * _M_pTaskExtension
Definition: concrt.h:5120
_CONCRTIMP const GUID PPLParallelInvokeEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to u...
_TaskCollectionStatus _ScheduleWithAutoInline(_UnrealizedChore *_PChore, _TaskInliningMode _InliningMode)
Schedule a chore with automatic inlining. The chore is pushed onto the associated workstealing queue...
Definition: concrt.h:5211
An event type that represents the act of unblocking a context.
Definition: concrt.h:5475
Definition: concrt.h:4305
long _M_recursionCount
Definition: concrt.h:859
_Scoped_lock(_NonReentrantBlockingLock &_Lock)
Definition: concrt.h:895
critical_section & _M_critical_section
Definition: concrt.h:3625
volatile unsigned long EnableFlags
Definition: concrt.h:5381
_SpinWait< 0 > _SpinWaitNoYield
Definition: concrt.h:760
#define _Post_invalid_
Definition: sal.h:692
Concrt_TraceFlags
Trace flags for the event types
Definition: concrt.h:5627
_CONCRTIMP void _ReleaseRead()
void _IncrementConstructedElemsCount()
Definition: concrt.h:1072
~location()
Destroys a location object.
Definition: concrt.h:1896
volatile long _M_signals
Definition: concrt.h:5287
_CONCRTIMP const GUID ConcRT_ProviderGuid
The ETW provider GUID for the Concurrency Runtime.
_MallocaListHolder & operator=(const _MallocaListHolder &)
_CONCRTIMP _NonReentrantBlockingLock()
virtual ~_Chore()
Definition: concrt.h:4184
_ElemNodeType & operator=(const _ElemNodeType &)
_At_(this->_M_FirstNode, _Pre_valid_) virtual ~_MallocaListHolder()
Definition: concrt.h:1133
Definition: concrt.h:5632
_CONCRTIMP native_handle_type native_handle()
Returns a platform specific native handle, if one exists.
_CONCRTIMP scheduler_not_attached()
Constructs a scheduler_not_attached object.
_CONCRTIMP void *__cdecl Alloc(size_t _NumBytes)
Allocates a block of memory of the size specified from the Concurrency Runtime Caching Suballocator...
_CONCRTIMP ~_Scoped_lock()
HRESULT _Hresult
Definition: concrt.h:1222
long _M_recursionCount
Definition: concrt.h:4166
static _Ty _Decrement(volatile _Ty &_Location)
Definition: concrt.h:435
_CONCRTIMP scoped_lock(critical_section &_Critical_section)
Constructs a scoped_lock object and acquires the critical_section object passed in the _Critical_sect...
_CONCRTIMP improper_scheduler_detach()
Constructs an improper_scheduler_detach object.
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:43
Definition: concrt.h:4172
#define _Pre_valid_
Definition: sal.h:668
location(const location &_Src)
Constructs a location object.
Definition: concrt.h:1849
_CONCRTIMP void _Release()
_ElemType * _InitOnRawMalloca(void *_MallocaRet)
Definition: concrt.h:1062
_CONCRTIMP ~event()
Destroys an event.
static _CONCRTIMP unsigned int __cdecl _Value()
_CONCRT_BUFFER _M_criticalSection[(4 *sizeof(void *)+2 *sizeof(long)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:915
_CONCRTIMP void _Release()
A writer-preference queue-based reader-writer lock with local only spinning. The lock grants first in...
Definition: concrt.h:3670
_CONCRTIMP reader_writer_lock()
Constructs a new reader_writer_lock object.
void _Construct(_Ty1 *_Ptr, _Ty2 &&_Val)
Definition: xmemory0:138
volatile long _M_exitCode
An indication of the exit code of the chore. Anything non-zero here indicates cancellation of one for...
Definition: concrt.h:5104
void _InternalDeleteHelper(_Ty *_PObject)
Definition: concrt.h:272
This class describes an exception thrown because of a failure to acquire a critical resource in the C...
Definition: concrt.h:1188
~_Scoped_lock()
Definition: concrt.h:798
::Concurrency::Scheduler * _M_pScheduler
Definition: concrt.h:385
bool _PerformedInlineCancel() const
Definition: concrt.h:4399
_MallocaArrayHolder()
Definition: concrt.h:1048
_CONCRTIMP const GUID ConcRTEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are not more specifically...
void _Lower()
Definition: concrt.h:5321
scoped_lock_read const & operator=(const scoped_lock_read &)
volatile long _M_flags
Definition: concrt.h:5124
unsigned __int64 * PDWORD_PTR
Definition: concrt.h:103
Indicates that the location represents a particular execution resource.
Definition: concrt.h:1960
_CONCRTIMP const GUID PPLParallelForeachEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to u...
Definition: pplinterface.h:224
_CONCRTIMP void _CheckTaskCollection()
_SpinWait _SpinWaitBackoffNone
Definition: concrt.h:759
void _PrepareStealUnstructured(ContextBase *_PContext)
An event type that represents the name for an object
Definition: concrt.h:5691
void *volatile _M_pTail
Definition: concrt.h:3646
unsigned int _M_reserved
Definition: concrt.h:2062
_CONCRTIMP void __cdecl _Trace_agents(Agents_EventType _Type, __int64 _AgentId,...)
_TaskCollectionStatus _Wait()
Waits for all chores running in the _StructuredTaskCollection to finish (normally or abnormally)...
Definition: concrt.h:4604
static _CONCRTIMP _Context __cdecl _CurrentContext()
void * _M_pCompletionContext
Definition: concrt.h:5131
_CONCRTIMP context_unblock_unbalanced()
Constructs a context_unblock_unbalanced object.
_NonReentrantPPLLock & operator=(const _NonReentrantPPLLock &)=delete
_CONCRTIMP bool try_lock_read()
Attempts to acquire the reader-writer lock as a reader without blocking.
_CONCRTIMP void unlock()
Unlocks the reader-writer lock based on who locked it, reader or writer.
_CONCRTIMP invalid_oversubscribe_operation()
Constructs an invalid_oversubscribe_operation object.
_CONCRT_BUFFER _M_node[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3626
A non-reentrant mutex which is explicitly aware of the Concurrency Runtime.
Definition: concrt.h:3488
_TaskCollectionStatus _Wait()
Waits for all chores running in the _TaskCollection to finish (normally or abnormally). This method encapsulates all the running tasks in an exception handling block, and will re-throw any exceptions that occur in any of it tasks (if those exceptions occur on another thread, they are marshaled from that thread to the thread where the _TaskCollection was created, and re-thrown). After this function returns, the _TaskCollection cannot be used for scheduling further work.
Definition: concrt.h:4809
void _Switch_to_active(void *_PWriter)
The writer node allocated on the stack never really owns the lock because it would go out of scope an...
location & operator=(const location &_Rhs)
Assigns the contents of a different location object to this one.
Definition: concrt.h:1886
static _CONCRTIMP unsigned int __cdecl _Id()
_ReentrantPPLLock & operator=(const _ReentrantPPLLock &)=delete
_CONCRTIMP _ReentrantBlockingLock()
std::exception_ptr * _M_pException
Definition: concrt.h:4468
bool _SpinOnce()
Spins for one time quantum,until a maximum spin is reached.
Definition: concrt.h:626
__declspec(noinline) static void __cdecl _StructuredChoreWrapper(_UnrealizedChore *_PChore)
_GROUP_AFFINITY * PGROUP_AFFINITY
Definition: concrt.h:58
_CONCRT_BUFFER _M_lockNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:4155
int _M_stackPos
Definition: concrt.h:5128
bool _M_fRepeating
Definition: concrt.h:5372
_CONCRTIMP context_self_unblock()
Constructs a context_self_unblock object.
_CONCRTIMP _Scheduler(::Concurrency::Scheduler *_PScheduler=NULL)
Definition: concrt.h:379
void _Reset()
Resets the counts and state to the default.
Definition: concrt.h:718
_CONCRTIMP improper_scheduler_reference()
Constructs an improper_scheduler_reference object.
#define _Pre_maybenull_
Definition: sal.h:678
static void __cdecl _CancelViaToken(::Concurrency::details::ContextBase *_PContext)
An event type that represents the act of a detaching from a scheduler.
Definition: concrt.h:5495
void * _CONCRT_BUFFER
Definition: concrt.h:129
_CONCRTIMP bool _TryAcquire()
_Scoped_lock(_ReaderWriterLock &_Lock)
Definition: concrt.h:968
_CONCRTIMP void reset()
Resets the event to a non-signaled state.
void _YieldProcessor()
Definition: concrt.h:80
_Scoped_lock(_ReentrantBlockingLock &_Lock)
Definition: concrt.h:792
An event type that represents the conclusion of some processing
Definition: concrt.h:5661
#define _In_z_
Definition: sal.h:310
bool _IsCurrentlyInlined() const
Definition: concrt.h:4348
Definition: concrt.h:5629
void _Switch_to_active(void *_PLockingNode)
The node allocated on the stack never really owns the lock because it would go out of scope and the i...
_Beacon_reference * _M_pRef
Definition: concrt.h:5328
This class describes an exception thrown when the Attach method is called on a Scheduler object which...
Definition: concrt.h:1316
static _Ty _CompareAndSwap(volatile _Ty &_Location, _Ty _NewValue, _Ty _Comperand)
Definition: concrt.h:420
#define _Inout_opt_
Definition: sal.h:376
This class describes an exception thrown when an operation is performed which requires a scheduler to...
Definition: concrt.h:1290
void _PrepareSteal(ContextBase *_PContext)
This class describes an exception thrown when an operation has timed out.
Definition: concrt.h:1712
This class describes an exception thrown when there are tasks still scheduled to a task_group or stru...
Definition: concrt.h:1491
_CONCRTIMP ~_ReentrantBlockingLock()
Definition: concrt.h:4089
HANDLE _M_hTimer
Definition: concrt.h:5366
_TaskInliningMode
The enum defines inlining scheduling policy for ppltasks. Scheduling a chore or a functor with _TaskI...
Definition: pplinterface.h:221
_SpinState _M_state
Definition: concrt.h:755
bool _FastNodeIntersects(const location &_Rhs) const
Determines whether two locations have an intersection. This is a fast intersection which avoids certa...
_Ty operator++(int)
Definition: concrt.h:509
_CONCRTIMP const GUID ChoreEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to c...
_CONCRTIMP invalid_scheduler_policy_key()
Constructs an invalid_scheduler_policy_key object.
unsigned int size_t
Definition: sourceannotations.h:19
static unsigned int _S_spinCount
Definition: concrt.h:557
_CONCRTIMP _Context(::Concurrency::Context *_PContext=NULL)
Definition: concrt.h:367
This class describes an exception thrown when a task_handle object is scheduled multiple times using ...
Definition: concrt.h:1746
_CONCRTIMP _ReaderWriterLock()
bool _Is_signaled() const
Definition: concrt.h:5307
_CONCRTIMP void __cdecl Free(_Pre_maybenull_ _Post_invalid_ void *_PAllocation)
Releases a block of memory previously allocated by the Alloc method to the Concurrency Runtime Cachin...
~_Scoped_lock()
Definition: concrt.h:847
_ElemType _M_Elem
Definition: concrt.h:1149
critical_section & operator=(const critical_section &)
Hide assignment operator for a critical section
_ElemNodeType * _M_Next
Definition: concrt.h:1150
#define _SAFERWLIST_SIZE
Definition: concrt.h:131
Definition: concrt.h:4303
friend class _StructuredTaskCollection
Definition: concrt.h:4264
_Ty * _As() const
Returns the internal binding as a specified object.
Definition: concrt.h:2024
_CONCRTIMP void _Acquire(void *_Lock_node)
bool _FastVPIntersects(const location &_Rhs) const
Determines whether two locations have an intersection. This is a fast intersection which avoids certa...
unsigned long _M_currentYield
Definition: concrt.h:754
void _RegisterConcRTEventTracing()
Register ConcRT as an ETW Event Provider.
size_t _GetAllocationSize() const
Definition: concrt.h:1104
reader_writer_lock & _M_reader_writer_lock
Definition: concrt.h:3795
_CONCRTIMP nested_scheduler_missing_detach()
Constructs a nested_scheduler_missing_detach object.
void _Remove_last_writer(void *_PWriter)
When the last writer leaves the lock, it needs to reset the tail to NULL so that the next coming writ...
_SECURITY_ATTRIBUTES * LPSECURITY_ATTRIBUTES
Definition: concrt.h:55
_NonReentrantBlockingLock & _M_lock
Definition: concrt.h:906
bool _TaskCleanup()
Performs task cleanup normally done at destruction time.
Definition: concrt.h:4640
bool _ShouldSpinAgain()
Determines whether maximum spin has been reached
Definition: concrt.h:748
This class describes an exception thrown when a messaging block is unable to find a requested message...
Definition: concrt.h:1544
::Concurrency::critical_section _M_criticalSection
Definition: concrt.h:4124
_CONCRTIMP void _Acquire()
::Concurrency::details::_TaskCollectionBase * _M_pTaskCollection
Definition: concrt.h:4269
Definition: concrt.h:5341
_CONCRTIMP bool _IsSynchronouslyBlocked() const
char * va_list
Definition: vadefs.h:39
_CONCRT_BUFFER _M_writerNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3796
_RefCounterBase(long _InitialCount=1)
Definition: concrt.h:4075
_CONCRTIMP const _CONCRT_TRACE_INFO * _GetConcRTTraceInfo()
Retrieves a pointer to the internal trace flags and level information for the Concurrency runtime ETW...
_CONCRTIMP _Scoped_lock(_ReentrantPPLLock &_Lock)
_Type _GetType() const
Returns the type which this location object represents.
Definition: concrt.h:2042
void _Flush_current_owner()
Guarantees that if any context holds the lock at the time the method is called, that context has rele...
_ReentrantBlockingLock & _M_lock
Definition: concrt.h:803
An event type that marks the beginning of a start/end event pair.
Definition: concrt.h:5460
Definition: pplcancellation_token.h:106
_CONCRTIMP invalid_scheduler_policy_thread_specification()
Constructs an invalid_scheduler_policy_value object.
_Ty operator--(int)
Definition: concrt.h:517
unsigned int _GetId() const
Returns the ID which this location object represents.
Definition: concrt.h:2033
~_Scoped_lock_read()
Definition: concrt.h:998
_TaskCollectionBase()
Definition: concrt.h:4313
An event type that represents the scheduling of a process
Definition: concrt.h:5673
_CONCRTIMP ~_NonReentrantBlockingLock()
void _Unlock_writer()
Called from unlock() when a writer is holding the lock. Writer unblocks the next writer in the list a...
#define LONG_MIN
Definition: limits.h:37
_Ty operator+=(_Ty _Addend)
Definition: concrt.h:521
unsigned long _M_currentSpin
Definition: concrt.h:753
Definition: concrt.h:5634
bool _GetRuntimeOwnsLifetime() const
Definition: concrt.h:4232
TaskProc _M_completionHandler
Definition: concrt.h:5130
_TaskCollectionStatus
Definition: concrt.h:4301
_ReaderWriterLock & _M_lock
Definition: concrt.h:981
_CONCRTIMP HRESULT get_error_code() const
Returns the error code that caused the exception.
bool _PerformedPendingCancel() const
Definition: concrt.h:4405
_TaskCollectionBaseState
Definition: concrt.h:4367
Definition: concrt.h:1146
Definition: concrt.h:5379
_CancellationTokenState * _M_pTokenState
Definition: concrt.h:4449
Definition: concrt.h:4197
::Concurrency::details::_TaskCollectionBase * _OwningCollection() const
Definition: concrt.h:4218
reader_writer_lock & operator=(const reader_writer_lock &_Lock)
Hide assignment operator for a reader_writer_lock
_Scoped_lock & operator=(const _Scoped_lock &)=delete
_CONCRTIMP operation_timed_out()
Constructs an operation_timed_out object.
unsigned __int64 DWORD_PTR
Definition: concrt.h:103
const unsigned int COOPERATIVE_TIMEOUT_INFINITE
Value indicating that a wait should never time out.
Definition: concrt.h:3478
_Chore(TaskProc _PFunction)
Definition: concrt.h:4176
unsigned long DWORD
Definition: concrt.h:63
_CONCRTIMP void _Acquire()
void _SetRuntimeOwnsLifetime(bool _FValue)
Definition: concrt.h:4225
_ElemType * _M_ElemArray
Definition: concrt.h:1088
This class describes an exception thrown when the Unblock method of a Context object is called from t...
Definition: concrt.h:1455
This class describes an exception thrown because of a failure to create a worker execution context in...
Definition: concrt.h:1235
~_StackGuard()
Definition: concrt.h:5150
bool _M_fDetached
Definition: concrt.h:4279
An event type that represents the initiation of some processing
Definition: concrt.h:5655
void * _M_pBinding
Definition: concrt.h:2079
void _EnableTrace(unsigned char _Level, unsigned long _Flags)
Definition: concrt.h:5384
An event type that represents the deletion of an object
Definition: concrt.h:5667
_CONCRTIMP ~scoped_lock()
Destroys a scoped_lock object and releases the critical section supplied in its constructor.
Task collections represent groups of work which step outside the strict structuring of the _Structure...
Definition: concrt.h:4702
_CONCRTIMP _NonReentrantPPLLock()
~_Scoped_lock()
Definition: concrt.h:974
unsigned int _GetBindingId() const
Gets the binding ID for this location.
Definition: concrt.h:2051
volatile long _M_completedStolenChores
Definition: concrt.h:4459
void _UnregisterConcRTEventTracing()
Unregister ConcRT as an ETW Event Provider.
An event type that represents the act of a context becoming idle.
Definition: concrt.h:5485
::Concurrency::Context * _M_pContext
Definition: concrt.h:373
unsigned int _M_type
Definition: concrt.h:2059
An abstraction of a physical location on hardware.
Definition: concrt.h:1825
static _CONCRTIMP location __cdecl current()
Returns a location object representing the most specific place the calling thread is executing...
_CONCRTIMP missing_wait()
Constructs a missing_wait object.
_CONCRTIMP invalid_scheduler_policy_value()
Constructs an invalid_scheduler_policy_value object.
_CONCRTIMP _ReentrantLock()
_CONCRTIMP bad_target()
Constructs a bad_target object.
_CONCRTIMP void _Acquire()
This class describes an exception thrown when the CurrentScheduler::Detach method is called on a cont...
Definition: concrt.h:1343
_Scoped_lock const & operator=(const _Scoped_lock &)
_CONCRTIMP const GUID SchedulerEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to s...
_CONCRTIMP size_t wait(unsigned int _Timeout=COOPERATIVE_TIMEOUT_INFINITE)
Waits for the event to become signaled.
_Scoped_lock(_ReentrantLock &_Lock)
Definition: concrt.h:841
_Scoped_lock const & operator=(const _Scoped_lock &)
_ReentrantLock & _M_lock
Definition: concrt.h:852
bool _Set_next_writer(void *_PWriter)
Called for the first context in the writer queue. It sets the queue head and it tries to claim the lo...
_CONCRTIMP invalid_multiple_scheduling()
Constructs an invalid_multiple_scheduling object.
_CONCRT_BUFFER _M_activeNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3644
_TaskCollection * _M_pNextAlias
Definition: concrt.h:5119
void _Invoke()
Definition: concrt.h:4209
_Scoped_lock const & operator=(const _Scoped_lock &)
static _Ty _Increment(volatile _Ty &_Location)
Definition: concrt.h:430
bool _Is_system() const
Internal routine that tells whether a location represents the "system location". This indicates no sp...
Definition: concrt.h:2014
Definition: concrt.h:4309
An event type that represents the act of a context yielding.
Definition: concrt.h:5480
_Scoped_lock const & operator=(const _Scoped_lock &)
bool _Acquire_lock(void *_PLockingNode, bool _FHasExternalNode)
Acquires this critical section given a specific node to lock.
_CONCRTIMP const GUID AgentEventGuid
A category GUID ({B9B5B78C-0713-4898-A21A-C67949DCED07}) describing ETW events fired by the Agents li...
void _Acquire_lock(void *_PLockingNode, bool _FHasExternalNode)
Acquires a write lock given a specific write node to lock.
This class describes an exception thrown when the Concurrency Runtime detects that you neglected to c...
Definition: concrt.h:1689
_ElemType * _AddRawMallocaNode(void *_MallocaRet)
Definition: concrt.h:1124
void _Cancel()
Cancels work on the task collection.
Definition: concrt.h:5239
This class describes an exception thrown when an unsupported operating system is used.
Definition: concrt.h:1264
location()
Constructs a location object.
Definition: concrt.h:1836
bool _M_fRuntimeOwnsLifetime
Definition: concrt.h:4276
_CONCRTIMP void unlock()
Unlocks the critical section.
An exception safe RAII wrapper that can be used to acquire reader_writer_lock lock objects as a write...
Definition: concrt.h:3774
static _CONCRTIMP location __cdecl _Current_node()
Returns a location representing the scheduling node that the calling thread is executing.
reader_writer_lock & _M_reader_writer_lock
Definition: concrt.h:3828
_StackGuard()
Definition: concrt.h:5141
void * _M_ptr
Definition: concrt.h:2074
Definition: concrt.h:1018
static const unsigned int timeout_infinite
Value indicating that a wait should never time out.
Definition: concrt.h:4016
volatile long _M_executionStatus
The status of the task collection.
Definition: concrt.h:5110
static void _StoreWithRelease(volatile _Ty &_Location, _Ty _Rhs)
Definition: concrt.h:406
_TaskCollectionBase * _SafeGetParent()
Definition: concrt.h:4412
_MallocaArrayHolder & operator=(const _MallocaArrayHolder &)
static void _InternalFree(_UnrealizedChore *_PChore)
Definition: pplcancellation_token.h:221
_CONCRTIMP void set()
Signals the event.
volatile unsigned char EnableLevel
Definition: concrt.h:5382
virtual ~_MallocaArrayHolder()
Definition: concrt.h:1078
volatile long _M_numberOfWriters
Definition: concrt.h:1030
bool _IsStructured()
Definition: concrt.h:4354
_CONCRTIMP const GUID ScheduleGroupEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to s...
_CONCRTIMP default_scheduler_exists()
Constructs a default_scheduler_exists object.
long __cdecl _InterlockedDecrement(long volatile *)
_TaskCollection * _M_pOriginalCollection
Definition: concrt.h:5118
_CONCRTIMP void _ReleaseWrite()
::Concurrency::critical_section _M_lock
Definition: concrt.h:4025
_CONCRTIMP void lock()
Acquires this critical section.
void * _Get_reader_convoy()
Called when writers are done with the lock, or when lock was free for claiming by the first reader co...
void * _M_pResetChain
Definition: concrt.h:4024
Definition: concrt.h:1019
_Type
Describes the type of the given location.
Definition: concrt.h:1940
#define _CONCRTIMP
Definition: crtdefs.h:48
unsigned int _CONCRTIMP __cdecl _GetConcurrency()
Returns the hardware concurrency available to the Concurrency Runtime, taking into account process af...
_CONCRTIMP void _AcquireRead()
_State
Definition: concrt.h:1016
#define _In_reads_(size)
Definition: sal.h:316
void _SetDetached(bool _FDetached)
void _DoYield()
Yields its time slice using the specified yieldFunction
Definition: concrt.h:697
long _Release()
Definition: concrt.h:4053
_CONCRTIMP bool try_lock()
Attempts to acquire the reader-writer lock as a writer without blocking.
_CONCRTIMP const GUID ResourceManagerEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to t...
volatile long _M_chaining
Definition: concrt.h:5125
Definition: concrt.h:5631
_Ty operator++()
Definition: concrt.h:505
static _CONCRTIMP unsigned int __cdecl _GetNumberOfVirtualProcessors()
Indicates that the location represents the "system location". This has no specific affinity...
Definition: concrt.h:1945
_CONCRTIMP _Scoped_lock(_NonReentrantPPLLock &_Lock)
An exception safe RAII wrapper that can be used to acquire reader_writer_lock lock objects as a reade...
Definition: concrt.h:3806
void *volatile _M_pWaitChain
Definition: concrt.h:4023
static _CONCRTIMP size_t __cdecl wait_for_multiple(_In_reads_(_Count) event **_PPEvents, size_t _Count, bool _FWaitAll, unsigned int _Timeout=COOPERATIVE_TIMEOUT_INFINITE)
Waits for multiple events to become signaled.
void * _M_pWriterHead
Definition: concrt.h:3898
_CONCRTIMP unsigned int _Reference()
_CONCRTIMP bool _TryAcquire()
size_t & _Depth
Definition: concrt.h:5163
unsigned long _NumberOfSpins()
Determines the current spin count
Definition: concrt.h:736
_ReentrantPPLLock & _M_lock
Definition: concrt.h:4154
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *unexpected_handler)()
volatile long _M_refCount
Definition: concrt.h:4081
void _Destroy(_Ptrty _Ptr)
Definition: xmemory0:287
This class describes an exception thrown when the Scheduler::SetDefaultSchedulerPolicy method is call...
Definition: concrt.h:1396
volatile _Ty _M_value
Definition: concrt.h:485
_ElemNodeType * _M_FirstNode
Definition: concrt.h:1159
_CONCRTIMP ~reader_writer_lock()
Destroys the reader_writer_lock object.
Definition: concrt.h:4144
_CONCRTIMP ~scoped_lock()
Destroys a reader_writer_lock object and releases the lock supplied in its constructor.
_CONCRTIMP unsupported_os()
Constructs an unsupported_os object.
void _Initialize(_ElemType *_Elem)
Definition: concrt.h:1051
_Chore()
Definition: concrt.h:4180
A manual reset event which is explicitly aware of the Concurrency Runtime.
Definition: concrt.h:3922
virtual ~_UnrealizedChore()
Definition: concrt.h:4205
void _SetSpinCount(unsigned int _Count)
Set a dynamic spin count.
Definition: concrt.h:598
Definition: concrt.h:1044
long __cdecl _InterlockedIncrement(long volatile *)
_CONCRTIMP improper_scheduler_attach()
Constructs an improper_scheduler_attach object.
unsigned int _M_id
Definition: concrt.h:2071
static _Ty _FetchAndAdd(volatile _Ty &_Location, _Ty _Addend)
Definition: concrt.h:425
This class describes an exception thrown when a policy key of a SchedulerPolicy object is set to an i...
Definition: concrt.h:1627
_Scoped_lock_read(_ReaderWriterLock &_Lock)
Definition: concrt.h:992
An exception safe RAII wrapper for a critical_section object.
Definition: concrt.h:3601
event & operator=(const event &_Event)
const size_t COOPERATIVE_WAIT_TIMEOUT
Value indicating that a wait timed out.
Definition: concrt.h:3469
_CONCRTIMP _SpinLock(volatile long &_Flag)
_CONCRTIMP::Concurrency::Scheduler * _GetScheduler()
Definition: concrt.h:382
bool _IsAbnormalExit() const
Definition: concrt.h:4381
bool operator==(const location &_Rhs) const
Determines whether two location objects represent the same location.
Definition: concrt.h:1907
_CONCRTIMP invalid_link_target()
Constructs an invalid_link_target object.
#define SIZE_MAX
Definition: limits.h:76
_CONCRTIMP critical_section()
Constructs a new critical section.
Internal maintenance structure for beacons.
Definition: concrt.h:5285
Definition: concrt.h:5636
volatile long _M_state
Definition: concrt.h:1025
_Ty _CompareAndSwap(_Ty _NewValue, _Ty _Comperand)
Definition: concrt.h:497
An event type that represents the act of a context blocking.
Definition: concrt.h:5470
_CONCRTIMP message_not_found()
Constructs a message_not_found object.
_In_ int _Value
Definition: setjmp.h:173
_CONCRTIMP void _AcquireWrite()
void _CONCRTIMP __cdecl _UnderlyingYield()
Default method for yielding during a spin wait
unsigned int _M_bindingId
Definition: concrt.h:2065
_StructuredTaskCollection()
Construct a new structured task collection.
Definition: concrt.h:4503
scoped_lock const & operator=(const scoped_lock &)
_CONCRT_BUFFER _M_activeWriter[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3896
long __cdecl _InterlockedCompareExchange(long volatile *, long, long)
static _CONCRTIMP void __cdecl _Oversubscribe(bool _BeginOversubscription)
_MallocaListHolder()
Definition: concrt.h:1109
static void __cdecl _InvokeBridge(void *_PContext)
Definition: concrt.h:4253
virtual void _Destroy()
Definition: concrt.h:4069
void * _M_pWriterTail
Definition: concrt.h:3899
_CONCRTIMP improper_lock()
Constructs an improper_lock exception.
_Scoped_lock_read const & operator=(const _Scoped_lock_read &)
_CONCRT_BUFFER _M_lockNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:4119
void * HANDLE
Definition: concrt.h:72
_Size
Definition: vcruntime_string.h:36
event _M_event
An event on which to wait for stolen chores to complete.
Definition: concrt.h:5116
Definition: concrt.h:5630
_CONCRTIMP ~critical_section()
Destroys a critical section.
typedef _Return_type_success_(return >=0) long HRESULT
volatile long _M_lockState
Definition: concrt.h:3900
Definition: concrt.h:4105
_CONCRTIMP const GUID LockEventGuid
A category GUID describing ETW events fired by the Concurrency Runtime that are directly related to l...
volatile long _M_owner
Definition: concrt.h:860
void * _OwningContext() const
Definition: concrt.h:4336
static _ChoreType * _InternalAlloc(const _Function &_Func)
Definition: concrt.h:4239
_CONCRTIMP bool try_lock()
Tries to acquire the lock without blocking.
This class describes an exception thrown when the Context::Oversubscribe method is called with the _B...
Definition: concrt.h:1772
static _CONCRTIMP _Scheduler __cdecl _Get()
_SpinState
State of the spin wait class.
Definition: concrt.h:684
_Ty operator--()
Definition: concrt.h:513
_CONCRTIMP void lock_read()
Acquires the reader-writer lock as a reader. If there are writers, active readers have to wait until ...
_CONCRTIMP bool _TryAcquireWrite()