21 #if !(defined (_M_X64) || defined (_M_IX86) || defined (_M_ARM))
22 #error ERROR: Concurrency Runtime is supported only on X64, X86 and ARM architectures.
26 #error ERROR: Concurrency Runtime is not supported when compiling /clr.
30 #error ERROR: Concurrency Runtime is supported only for C++.
43 #pragma pack(push,_CRT_PACKING)
44 #pragma push_macro("new")
49 struct _SECURITY_ATTRIBUTES;
52 struct _GROUP_AFFINITY;
58 #ifndef _HRESULT_DEFINED
59 #define _HRESULT_DEFINED
63 typedef __success(
return >= 0) long HRESULT;
71 #undef _YieldProcessor
73 #if (defined (_M_IX86) || defined (_M_X64))
74 #define _YieldProcessor _mm_pause
81 #if defined (_M_IX86) && !defined(FIXED_592562) // Leave enabled until onflict with inline function in 8.1 SDK winnt.h header is fixed
83 #undef _InterlockedExchangePointer
84 #undef _InterlockedCompareExchangePointer
86 #define _InterlockedExchangePointer(_Target, _Value) reinterpret_cast<void *>(static_cast<__w64 long>(_InterlockedExchange( \
87 static_cast<long volatile *>(reinterpret_cast<__w64 long volatile *>(static_cast<void * volatile *>(_Target))), \
88 static_cast<long>(reinterpret_cast<__w64 long>(static_cast<void *>(_Value))))))
90 #define _InterlockedCompareExchangePointer(_Target, _Exchange, _Comparand) reinterpret_cast<void *>(static_cast<__w64 long>(_InterlockedCompareExchange( \
91 static_cast<long volatile *>(reinterpret_cast<__w64 long volatile *>(static_cast<void * volatile *>(_Target))), \
92 static_cast<long>(reinterpret_cast<__w64 long>(static_cast<void *>(_Exchange))), \
93 static_cast<long>(reinterpret_cast<__w64 long>(static_cast<void *>(_Comparand))))))
97 #if (defined (_M_IX86) || defined (_M_ARM))
99 #define _InterlockedIncrementSizeT(_Target) static_cast<size_t>(_InterlockedIncrement(reinterpret_cast<long volatile *>(_Target)))
100 #define _InterlockedDecrementSizeT(_Target) static_cast<size_t>(_InterlockedDecrement(reinterpret_cast<long volatile *>(_Target)))
101 #define _InterlockedCompareExchangeSizeT(_Target, _Exchange, _Comparand) static_cast<size_t>(_InterlockedCompareExchange( \
102 reinterpret_cast<long volatile *>(_Target), \
103 static_cast<long>(_Exchange), \
104 static_cast<long>(_Comparand)))
110 #define _InterlockedIncrementSizeT(_Target) static_cast<size_t>(_InterlockedIncrement64(reinterpret_cast<__int64 volatile *>(_Target)))
111 #define _InterlockedDecrementSizeT(_Target) static_cast<size_t>(_InterlockedDecrement64(reinterpret_cast<__int64 volatile *>(_Target)))
112 #define _InterlockedCompareExchangeSizeT(_Target, _Exchange, _Comparand) static_cast<size_t>(_InterlockedCompareExchange64( \
113 reinterpret_cast<__int64 volatile *>(_Target), \
114 static_cast<__int64>(_Exchange), \
115 static_cast<__int64>(_Comparand)))
132 #define _CONCRT_ASSERT(x) __pragma (warning (suppress: 4127)) do {_ASSERTE(x); __assume(x);} while(false)
134 #define _CONCRT_ASSERT(x) do {_ASSERTE(x); __assume(x);} while(false)
137 #define _CONCRT_ASSERT(x) __assume(x)
144 #define _LISTENTRY_SIZE ((2 * sizeof(void *) + sizeof(_CONCRT_BUFFER) - 1) / sizeof(_CONCRT_BUFFER))
145 #define _SAFERWLIST_SIZE ((3 * sizeof(void *) + 2 * sizeof(long) + sizeof(_CONCRT_BUFFER) - 1) / sizeof(_CONCRT_BUFFER))
168 _CRTIMP void __cdecl
wait(
unsigned int _Milliseconds);
208 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
232 _CRTIMP void __cdecl set_task_execution_resources(DWORD_PTR _ProcessAffinityMask);
280 class _TaskCollectionBase;
302 void operator delete(
void * _Ptr)
throw()
308 void *
operator new(
size_t _Size,
const std::nothrow_t&)
throw()
325 void operator delete(
void * _Ptr,
const std::nothrow_t&)
throw()
327 operator delete(_Ptr);
333 return operator new(
_Size);
337 void operator delete[](
void * _Ptr)
throw()
339 operator delete(_Ptr);
343 void *
operator new[](
size_t _Size,
const std::nothrow_t& _No_throw)
throw ()
345 return operator new(
_Size, _No_throw);
349 void operator delete[](
void * _Ptr,
const std::nothrow_t& _No_throw)
throw()
351 operator delete(_Ptr, _No_throw);
355 void *
operator new(
size_t,
void * _Location)
throw()
361 void operator delete(
void *,
void *)
throw()
366 void * __cdecl
operator new[](
size_t,
void * _Location)
throw()
372 void __cdecl
operator delete[](
void *,
void *)
throw()
414 template <
size_t _Size>
419 template <
typename _Ty>
426 template <
typename _Ty>
433 template <
typename _Ty>
438 template <
typename _Ty>
440 return (_Ty)_InterlockedExchangeAdd((
volatile long*)&_Location, (
long)_Addend);
443 template <
typename _Ty>
448 template <
typename _Ty>
456 struct _Subatomic_impl<8> {
457 template <
typename _Ty>
458 static void _StoreWithRelease(
volatile _Ty& _Location, _Ty _Rhs) {
463 template <
typename _Ty>
464 static _Ty _LoadWithAquire(
volatile _Ty& _Location) {
469 template <
typename _Ty>
470 static _Ty _CompareAndSwap(
volatile _Ty& _Location, _Ty _NewValue, _Ty _Comperand) {
471 return (_Ty)_InterlockedCompareExchange64((
volatile __int64*)&_Location, (__int64)_NewValue, (__int64)_Comperand);
474 template <
typename _Ty>
475 static _Ty _FetchAndAdd(
volatile _Ty& _Location, _Ty _Addend) {
476 return (_Ty)_InterlockedExchangeAdd64((
volatile __int64*)&_Location, (__int64)_Addend);
479 template <
typename _Ty>
480 static _Ty _Increment(
volatile _Ty& _Location) {
481 return (_Ty)_InterlockedIncrement64((
volatile __int64*)&_Location);
484 template <
typename _Ty>
485 static _Ty _Decrement(
volatile _Ty& _Location) {
486 return (_Ty)_InterlockedDecrement64((
volatile __int64*)&_Location);
496 template <
typename _Ty>
502 operator _Ty()
const volatile {
603 template<
unsigned int _YieldCount = 1>
608 typedef void (__cdecl *_YieldFunction)();
615 : _M_yieldFunction(_YieldMethod), _M_state(_StateInitial)
630 _M_state = _StateSingle;
635 _M_currentYield = _YieldCount;
636 _M_state = _StateSpin;
658 unsigned long _Count = _NumberOfSpins();
660 for (
unsigned long _I = 0; _I <
_Count; _I++)
665 if (!_ShouldSpinAgain())
667 _M_state = (_M_currentYield == 0) ? _StateBlock : _StateYield;
675 if (--_M_currentYield == 0)
677 _M_state = _StateBlock;
725 bool _ShouldYield = (_YieldCount != 0);
743 _M_state = _StateInitial;
773 return (--_M_currentSpin > 0);
1066 template<
typename _ElemType>
1087 if (_MallocaRet ==
nullptr)
1088 throw std::bad_alloc();
1089 _Initialize(static_cast<_ElemType *>(_MallocaRet));
1090 return static_cast<_ElemType *
>(_MallocaRet);
1122 template<
typename _ElemType>
1149 if (_MallocaRet ==
nullptr)
1150 throw std::bad_alloc();
1151 _AddNode(static_cast<_ElemType *>(_MallocaRet));
1152 return static_cast<_ElemType *
>(_MallocaRet);
1160 auto _M_Next = _Node->_M_Next;
1161 _Node->_M_Elem._ElemType::~_ElemType();
1930 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
1942 _CRTIMP static location __cdecl from_numa_node(
unsigned short _NumaNodeNumber);
2099 template<
typename T>
2158 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
2197 virtual unsigned int Id()
const =0;
2216 virtual unsigned int Reference() =0;
2237 virtual unsigned int Release() =0;
2246 virtual ~ScheduleGroup() {};
2255 const unsigned int MaxExecutionResources = 0xFFFFFFFF;
2263 const unsigned int INHERIT_THREAD_PRIORITY = 0x0000F000;
2274 enum PolicyElementKey
2317 TargetOversubscriptionFactor,
2328 LocalContextCacheSize,
2366 DynamicProgressFeedback,
2376 WinRTInitialization,
2406 UmsThreadDefault = ThreadScheduler
2409 #pragma deprecated(UmsThreadDefault)
2418 enum SchedulingProtocolType
2426 EnhanceScheduleGroupLocality,
2433 EnhanceForwardProgress
2444 enum DynamicProgressFeedbackType
2453 ProgressFeedbackDisabled,
2462 ProgressFeedbackEnabled
2472 enum WinRTInitializationType
2479 InitializeWinRTAsMTA,
2486 DoNotInitializeWinRT
2502 class SchedulerPolicy
2549 _CRTIMP SchedulerPolicy(
size_t _PolicyKeyCount, ...);
2573 _CRTIMP SchedulerPolicy(
const SchedulerPolicy& _SrcPolicy);
2592 _CRTIMP SchedulerPolicy& operator=(
const SchedulerPolicy& _RhsPolicy);
2616 _CRTIMP unsigned int GetPolicyValue(PolicyElementKey _Key)
const;
2642 _CRTIMP unsigned int SetPolicyValue(PolicyElementKey _Key,
unsigned int _Value);
2663 _CRTIMP void SetConcurrencyLimits(
unsigned int _MinConcurrency,
unsigned int _MaxConcurrency = MaxExecutionResources);
2674 void _ValidateConcRTPolicy()
const;
2682 unsigned int _M_pPolicyBag[MaxPolicyElementKey];
2685 SchedulerType _M_schedulerKind;
2686 unsigned int _M_maxConcurrency;
2687 unsigned int _M_minConcurrency;
2688 unsigned int _M_targetOversubscriptionFactor;
2689 unsigned int _M_localContextCacheSize;
2690 unsigned int _M_contextStackSize;
2691 unsigned int _M_contextPriority;
2692 SchedulingProtocolType _M_schedulingProtocol;
2693 DynamicProgressFeedbackType _M_dynamicProgressFeedback;
2694 WinRTInitializationType _M_WinRTInitialization;
2695 } _M_specificValues;
2703 void _Initialize(
size_t _PolicyKeyCount,
va_list * _PArgs);
2709 void _Assign(
const SchedulerPolicy& _SrcPolicy);
2715 static bool __cdecl _ValidPolicyKey(PolicyElementKey _Key);
2721 static bool __cdecl _ValidPolicyValue(PolicyElementKey _Key,
unsigned int _Value);
2727 static bool __cdecl _AreConcurrencyLimitsValid(
unsigned int _MinConcurrency,
unsigned int _MaxConcurrency);
2728 bool _AreConcurrencyLimitsValid()
const;
2734 bool _ArePolicyCombinationsValid()
const;
2740 void _ResolvePolicyValues();
2746 static char * __cdecl _StringFromPolicyKey(
unsigned int _Index);
2761 class CurrentScheduler
2764 CurrentScheduler() {}
2777 _CRTIMP static unsigned int __cdecl Id();
2791 _CRTIMP static SchedulerPolicy __cdecl GetPolicy();
2805 _CRTIMP static Scheduler * __cdecl Get();
2820 _CRTIMP static unsigned int __cdecl GetNumberOfVirtualProcessors();
2845 _CRTIMP static void __cdecl Create(
const SchedulerPolicy& _Policy);
2864 _CRTIMP static void __cdecl Detach();
2880 _CRTIMP static void __cdecl RegisterShutdownEvent(HANDLE _ShutdownEvent);
2903 _CRTIMP static ScheduleGroup * __cdecl CreateScheduleGroup();
2929 _CRTIMP static ScheduleGroup * __cdecl CreateScheduleGroup(location& _Placement);
2993 _CRTIMP static bool __cdecl IsAvailableLocation(
const location& _Placement);
3034 virtual ~Scheduler() {}
3062 _CRTIMP static Scheduler * __cdecl Create(
const SchedulerPolicy& _Policy);
3071 virtual unsigned int Id()
const =0;
3082 virtual unsigned int GetNumberOfVirtualProcessors()
const =0;
3095 virtual SchedulerPolicy GetPolicy()
const =0;
3112 virtual unsigned int Reference() =0 ;
3127 virtual unsigned int Release() =0;
3138 virtual void RegisterShutdownEvent(HANDLE _Event) =0;
3156 virtual void Attach() =0;
3176 _CRTIMP static void __cdecl SetDefaultSchedulerPolicy(
const SchedulerPolicy& _Policy);
3190 _CRTIMP static void __cdecl ResetDefaultSchedulerPolicy();
3210 virtual ScheduleGroup * CreateScheduleGroup() =0;
3233 virtual ScheduleGroup * CreateScheduleGroup(location& _Placement) =0;
3268 virtual void ScheduleTask(
TaskProc _Proc,
_Inout_opt_ void * _Data, location& _Placement) =0;
3285 virtual bool IsAvailableLocation(
const location& _Placement)
const =0;
3315 virtual unsigned int GetId()
const =0;
3330 virtual unsigned int GetVirtualProcessorId()
const =0;
3345 virtual unsigned int GetScheduleGroupId()
const =0;
3355 _CRTIMP static unsigned int __cdecl Id();
3370 _CRTIMP static unsigned int __cdecl VirtualProcessorId();
3381 _CRTIMP static unsigned int __cdecl ScheduleGroupId();
3404 _CRTIMP static void __cdecl Block();
3427 virtual void Unblock() =0;
3445 virtual bool IsSynchronouslyBlocked()
const =0;
3457 _CRTIMP static void __cdecl _SpinYield();
3470 _CRTIMP static void __cdecl Yield();
3483 _CRTIMP static bool __cdecl IsCurrentTaskCollectionCanceling();
3496 _CRTIMP static Context * __cdecl CurrentContext();
3508 _CRTIMP static void __cdecl Oversubscribe(
bool _BeginOversubscription);
3517 virtual ~Context() {};
3655 bool _Acquire_lock(
void * _PLockingNode,
bool _FHasExternalNode);
3828 void _Acquire_lock(
void * _PLockingNode,
bool _FHasExternalNode);
3891 scoped_lock_read
const &
operator=(
const scoped_lock_read&);
4080 event(
const event& _Event);
4151 _Condition_variable&
operator=(
const _Condition_variable& _Event);
4360 template <
typename _ChoreType,
typename _Function>
4364 _ChoreType *
_Chore =
new _ChoreType(_Func);
4365 _Chore->_M_fRuntimeOwnsLifetime =
true;
4374 template <
typename _ChoreType>
4377 auto _PChore =
static_cast<_ChoreType *
>(_PContext);
4436 _M_pTokenState(
NULL),
4437 _M_completedStolenChores(_CollectionNotInitialized),
4438 _M_unpoppedChores(0),
4439 _M_pException(
NULL),
4440 _M_inliningDepth(_S_notInlined)
4446 _M_pTokenState(_PTokenState),
4447 _M_completedStolenChores(_CollectionNotInitialized),
4448 _M_unpoppedChores(0),
4449 _M_pException(
NULL),
4450 _M_inliningDepth(_S_notInlined)
4457 return _M_pOwningContext;
4463 return _M_inliningDepth;
4469 return (_M_inliningDepth != _S_notInlined);
4475 return (_M_inlineFlags & _S_structured) != 0;
4484 friend class Concurrency::details::ContextBase;
4490 _CollectionInitialized = 0
4496 return (std::exception_ptr *) ((
size_t)_M_pException & ~_S_cancelBitsMask);
4502 return _M_pException !=
NULL;
4508 return (
size_t) _M_pException & _S_cancelBitsMask;
4514 return (_CancelState() & _S_cancelBitsMask) != 0;
4521 return _CancelState() == _S_cancelShotdownOwner;
4527 return _CancelState() == _S_cancelDeferredShootdownOwner;
4533 return ((_M_inliningDepth != _S_notInlined) ? _M_pParent :
NULL);
4537 bool _WillInterruptForPendingCancel();
4541 void _RaisedException();
4545 void _RethrowException();
4548 bool _MarkCancellation();
4552 void _FinishCancelState(
size_t _NewCancelState);
4557 void _RaisedCancel();
4564 int _M_inliningDepth : 28;
4565 int _M_inlineFlags : 4;
4590 static const size_t _S_cancelBitsMask = 0x3;
4591 static const size_t _S_cancelNone = 0x0;
4592 static const size_t _S_cancelStarted = 0x1;
4593 static const size_t _S_cancelDeferredShootdownOwner = 0x2;
4594 static const size_t _S_cancelShotdownOwner = 0x3;
4597 static const size_t _S_nonNull = 0x8;
4598 static const size_t _S_cancelException = 0xC;
4601 static const int _S_notInlined = -1;
4604 static const int _S_structured = 0x00000001;
4605 static const int _S_localCancel = 0x00000002;
4606 static const int _S_reserved = 0x0000000C;
4631 _M_pTokenState =
NULL;
4729 return _RunAndWait();
4736 void _CancelStolenContexts();
4744 _M_pOwningContext =
NULL;
4745 _M_inlineFlags = _S_structured;
4770 if (_M_unpoppedChores > 0)
4796 void _WaitOnStolenChores(
long _StolenChoreCount);
4815 _CONCRT_BUFFER _M_event[(
sizeof(
void*) +
sizeof(_CONCRT_BUFFER) - 1) /
sizeof(_CONCRT_BUFFER)];
4932 return _RunAndWait();
4939 bool _IsMarkedForAbnormalExit()
const;
4945 _TaskCollection * _OriginalCollection()
const;
4951 bool _IsAlias()
const;
4963 void _RegisterCompletionHandler(
TaskProc _Func,
void * _PCompletionContext);
4968 friend class Concurrency::details::ContextBase;
4975 bool _IsStaleAlias()
const;
4981 void _ReleaseAlias();
4993 _TaskCollection(_TaskCollection * _POriginCollection,
bool _FDirectAlias);
4999 _TaskCollection * _Alias();
5008 void _Abort(
bool fLeaveCanceled =
false);
5014 bool _IsIndirectAlias()
const;
5020 bool _IsDirectAlias()
const;
5026 bool _HasDirectAlias()
const;
5039 void _Cancel(
bool _InsideException, _TaskCollection * _PSnapPoint);
5045 void _NotifyNewChore();
5063 void _FullAliasWait(_TaskCollection * _PSnapPoint);
5072 void _Reset(_TaskCollection * _PSnapPoint);
5080 void _RaisedException();
5088 void _RaisedCancel();
5100 bool _SetCancelState(
long _Status);
5110 void _CancelFromArbitraryThread(
bool _InsideException);
5123 void _CancelDirectAliases(
bool _InsideException, _TaskCollection * _PSnapPoint);
5138 void _CancelStolenContexts(
bool _InsideException,
bool _FInlineGated);
5144 void *_GetStealTrackingList()
const;
5159 void _AbortiveSweep(
void *_PCtx);
5174 static bool __cdecl _CollectionMatchPredicate(
_UnrealizedChore *_PChore,
void *_PData);
5189 static bool __cdecl _SweepAbortedChore(
_UnrealizedChore *_PChore,
void *_PData);
5198 bool _TaskCleanup(
bool fExceptional);
5243 int _M_taskCookies[2];
5302 return _Depth <= static_cast<size_t>(_InliningMode);
5313 _CRTIMP static size_t & __cdecl _GetCurrentInlineDepth();
5360 _M_taskCollection._Schedule(_PChore);
5368 return _M_taskCollection._RunAndWait(_PChore);
5372 _M_taskCollection._Schedule(_PChore);
5383 _M_taskCollection._Cancel();
5403 return _M_taskCollection._RunAndWait();
5408 void _NotificationHandler();
5416 static
void __cdecl _CompletionHandler(
void * _PCompletionContext);
5453 _CRTIMP ~_Cancellation_beacon();
5457 return (_M_pRef->_M_signals != 0);
5462 _CRTIMP bool _Confirm_cancel();
5508 friend class _TimerStub;
5511 virtual void _Fire() =0;
5534 EnableFlags = flags;
5535 EnableLevel = level;
5546 return ((level <= EnableLevel) && ((EnableFlags & flags) == flags));
5579 __declspec(deprecated(
"Concurrency::EnableTracing is a deprecated function."))
_CRTIMP HRESULT __cdecl EnableTracing();
5658 extern "C" const __declspec(selectany) GUID ConcRT_ProviderGuid = { 0xF7B697A3, 0x4DB5, 0x4d3b, { 0xBE, 0x71, 0xC4, 0xD2, 0x84, 0xE6, 0x59, 0x2F } };
5671 extern "C" const __declspec(selectany) GUID ConcRTEventGuid = { 0x72B14A7D, 0x704C, 0x423e, { 0x92, 0xF8, 0x7E, 0x6D, 0x64, 0xBC, 0xB9, 0x2A } };
5679 extern "C" const __declspec(selectany) GUID SchedulerEventGuid = { 0xE2091F8A, 0x1E0A, 0x4731, { 0x84, 0xA2, 0x0D, 0xD5, 0x7C, 0x8A, 0x52, 0x61 } };
5689 extern "C" const __declspec(selectany) GUID ScheduleGroupEventGuid = { 0xE8A3BF1F, 0xA86B, 0x4390, { 0x9C, 0x60, 0x53, 0x90, 0xB9, 0x69, 0xD2, 0x2C } };
5696 extern "C" const __declspec(selectany) GUID ContextEventGuid = { 0x5727A00F, 0x50BE, 0x4519, { 0x82, 0x56, 0xF7, 0x69, 0x98, 0x71, 0xFE, 0xCB } };
5707 extern "C" const __declspec(selectany) GUID ChoreEventGuid = { 0x7E854EC7, 0xCDC4, 0x405a, { 0xB5, 0xB2, 0xAA, 0xF7, 0xC9, 0xE7, 0xD4, 0x0C } };
5713 extern "C" const __declspec(selectany) GUID VirtualProcessorEventGuid = { 0x2f27805f, 0x1676, 0x4ecc, { 0x96, 0xfa, 0x7e, 0xb0, 0x9d, 0x44, 0x30, 0x2f } };
5724 extern "C" const __declspec(selectany) GUID LockEventGuid = { 0x79A60DC6, 0x5FC8, 0x4952, { 0xA4, 0x1C, 0x11, 0x63, 0xAE, 0xEC, 0x5E, 0xB8 } };
5734 extern "C" const __declspec(selectany) GUID ResourceManagerEventGuid = { 0x2718D25B, 0x5BF5, 0x4479, { 0x8E, 0x88, 0xBA, 0xBC, 0x64, 0xBD, 0xBF, 0xCA } };
5742 extern "C" const __declspec(selectany) GUID PPLParallelInvokeEventGuid = { 0xd1b5b133, 0xec3d, 0x49f4, { 0x98, 0xa3, 0x46, 0x4d, 0x1a, 0x9e, 0x46, 0x82 } };
5750 extern "C" const __declspec(selectany) GUID PPLParallelForEventGuid = { 0x31c8da6b, 0x6165, 0x4042, { 0x8b, 0x92, 0x94, 0x9e, 0x31, 0x5f, 0x4d, 0x84 } };
5758 extern "C" const __declspec(selectany) GUID PPLParallelForeachEventGuid = { 0x5cb7d785, 0x9d66, 0x465d, { 0xba, 0xe1, 0x46, 0x11, 0x6, 0x1b, 0x54, 0x34 } };
5764 extern "C" const __declspec(selectany) GUID AgentEventGuid = {0xb9b5b78c, 0x713, 0x4898, { 0xa2, 0x1a, 0xc6, 0x79, 0x49, 0xdc, 0xed, 0x7 } };
5866 #pragma pop_macro("new")
friend class _TaskCollection
Definition: concrt.h:4387
_CRTIMP improper_lock()
Constructs an improper_lock exception.
DWORD _M_boundQueueId
Definition: concrt.h:5248
_Scoped_lock const & operator=(const _Scoped_lock &)
void operator=(const _SpinLock &)
A cancellation beacon is a flag which can be polled in an inlinable fashion using the is_signaled met...
Definition: concrt.h:5447
This class describes an exception thrown when the link_target method of a messaging block is called a...
Definition: concrt.h:1593
_CRTIMP ~_NonReentrantBlockingLock()
std::exception_ptr * _Exception() const
Definition: concrt.h:4494
_CRTIMP bool try_lock()
Attempts to acquire the reader-writer lock as a writer without blocking.
int _InliningDepth() const
Definition: concrt.h:4461
void _Raise()
Definition: concrt.h:5464
_CRTIMP _Scoped_lock(_NonReentrantPPLLock &_Lock)
void _PrepareStealStructured(ContextBase *_PContext)
void _Assign(const location &_Rhs)
Assigns _Rhs to this location.
Definition: concrt.h:2075
_CRTIMP unsupported_os()
Constructs an unsupported_os object.
_CRTIMP ~reader_writer_lock()
Destroys the reader_writer_lock object.
void * _M_pReaderHead
Definition: concrt.h:3957
void _AddNode(_ElemType *_Elem)
Definition: concrt.h:1137
bool _ShouldInline(_TaskInliningMode _InliningMode) const
Definition: concrt.h:5298
~_Scoped_lock()
Definition: concrt.h:924
Definition: functional:256
long _Reference()
Definition: concrt.h:4169
This class describes an exception thrown when an attempt is made to set the concurrency limits of a S...
Definition: concrt.h:1678
Definition: concrt.h:1123
_ReaderWriterLock & _M_lock
Definition: concrt.h:1028
_YieldFunction _M_yieldFunction
Definition: concrt.h:779
Agents_EventType
The types of events that can be traced using the tracing functionality offered by the Agents Library ...
Definition: concrt.h:5789
_SpinWait(_YieldFunction _YieldMethod=_UnderlyingYield)
Construct a spin wait object
Definition: concrt.h:614
_CRTIMP invalid_operation()
Constructs an invalid_operation object.
This class describes an exception thrown when an invalid operation is performed that is not more accu...
Definition: concrt.h:1705
An event type used for miscellaneous events.
Definition: concrt.h:5601
static void __cdecl _Initialize()
Definition: concrt.h:1043
_CRTIMP _In_ int _Value
Definition: setjmp.h:190
_CRTIMP bool _TryAcquire()
Indicates that the location represents a particular NUMA node.
Definition: concrt.h:2026
An event type that marks the beginning of a start/end event pair.
Definition: concrt.h:5611
size_t _M_ElemsConstructed
Definition: concrt.h:1112
_NonReentrantPPLLock & _M_lock
Definition: concrt.h:4240
_CRTIMP ~_ReentrantBlockingLock()
_CRTIMP _NonReentrantBlockingLock()
_CRTIMP invalid_scheduler_policy_thread_specification()
Constructs an invalid_scheduler_policy_value object.
Concurrency::details::_TaskCollectionBase * _OwningCollection() const
Definition: concrt.h:4340
_CRTIMP bool _TryAcquire()
critical_section & native_handle_type
A reference to a critical_section object.
Definition: concrt.h:3617
_CRTIMP size_t wait(unsigned int _Timeout=COOPERATIVE_TIMEOUT_INFINITE)
Waits for the event to become signaled.
Structured task collections represent groups of work which follow a strictly LIFO ordered paradigm qu...
Definition: concrt.h:4620
void * _M_pOwningContext
Definition: concrt.h:4571
Async Task collections is a thin wrapper over task collection to cater to the execution of asynchrono...
Definition: concrt.h:5321
This class describes an exception thrown when a lock is acquired improperly.
Definition: concrt.h:1851
static _CRTIMP void __cdecl _ScheduleTask(TaskProc _Proc, void *_Data)
long _M_activeStealersForCancellation
A count of active stealers for CANCELLATION PURPOSES ONLY. This is non-interlocked and guarded by the...
Definition: concrt.h:5218
An event type that represents the linking of message blocks
Definition: concrt.h:5825
This class describes an exception thrown when an invalid or unknown key is passed to a SchedulerPolic...
Definition: concrt.h:1622
static _Ty _LoadWithAquire(volatile _Ty &_Location)
Definition: concrt.h:427
void _Construct()
Definition: concrt.h:4742
An event type that represents the unlinking of message blocks
Definition: concrt.h:5831
volatile long _M_owner
Definition: concrt.h:4291
An event type that represents the act of a attaching to a scheduler.
Definition: concrt.h:5636
_Scoped_lock const & operator=(const _Scoped_lock &)
_CRTIMP unsigned int _Release()
void _DisableTrace()
Definition: concrt.h:5538
#define _CRTIMP
Definition: crtdefs.h:23
_CRTIMP message_not_found()
Constructs a message_not_found object.
Implements busy wait with no backoff
Definition: concrt.h:604
bool operator!=(const location &_Rhs) const
Determines whether two location objects represent different location.
Definition: concrt.h:1995
TaskProc m_pFunction
Definition: concrt.h:4313
_CRTIMP default_scheduler_exists()
Constructs a default_scheduler_exists object.
#define _CONCRT_ASSERT(x)
Definition: concrt.h:137
Definition: concrt.h:4426
Definition: concrt.h:5277
_TaskCollectionBase * _M_pParent
Definition: concrt.h:4561
_Ty _FetchAndAdd(_Ty _Addend)
Definition: concrt.h:515
_TaskCollectionBase(_CancellationTokenState *_PTokenState)
Definition: concrt.h:4445
Definition: concrt.h:4253
_CRTIMP invalid_oversubscribe_operation()
Constructs an invalid_oversubscribe_operation object.
bool _IsMarkedForCancellation() const
Definition: concrt.h:4512
_CRTIMP bool wait_for(Concurrency::critical_section &_Lck, unsigned int _Timeout=COOPERATIVE_TIMEOUT_INFINITE)
Waits for the _Condition_variable to become signaled. The lock argument passed in is unlocked by the ...
static _CRTIMP location __cdecl current()
Returns a location object representing the most specific place the calling thread is executing...
unsigned int _M_ms
Definition: concrt.h:5517
_CRTIMP ~event()
Destroys an event.
Definition: concrt.h:4158
_UnrealizedChore()
Definition: concrt.h:4323
T * _As() const
Returns the internal binding as a specified object.
Definition: concrt.h:2100
Indicates that the location represents a particular scheduling node.
Definition: concrt.h:2031
_W64 unsigned int size_t
Definition: crtdefs.h:496
This class describes an exception thrown when the Reference method is called on a Scheduler object th...
Definition: concrt.h:1393
_Ty operator=(_Ty _Rhs)
Definition: concrt.h:506
Definition: concrt.h:5779
void(__cdecl * CHOREFUNC)(_UnrealizedChore *_PChore)
Definition: concrt.h:4388
_CRTIMP void lock()
Acquires the reader-writer lock as a writer.
_CRTIMP _Interruption_exception()
void *volatile _M_pHead
Definition: concrt.h:3705
bool _HasWriteLock() const
Definition: concrt.h:978
volatile long & _M_flag
Definition: concrt.h:558
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...
_CRTIMP task_canceled()
Constructs a task_canceled object.
_TaskCollectionStatus _RunAndWait()
A cancellation friendly wrapper with which to execute _PChore and then waits for all chores running i...
Definition: concrt.h:5399
_CRTIMP context_self_unblock()
Constructs a context_self_unblock object.
typedef __success(return >=0) long HRESULT
CHOREFUNC _M_pChoreFunction
Definition: concrt.h:4394
This class describes an exception thrown when calls to the Block and Unblock methods of a Context obj...
Definition: concrt.h:1452
This class describes an exception thrown when a messaging block is given a pointer to a target which ...
Definition: concrt.h:1543
void(__cdecl * TaskProc)(void *)
Concurrency::details contains definitions of support routines in the public namespaces and one or mor...
Definition: concrt.h:265
This class describes an exception thrown by the PPL tasks layer in order to force the current task to...
Definition: concrt.h:1879
void(__cdecl * _UnobservedExceptionHandler)(void)
Definition: concrt.h:5432
_CONCRT_BUFFER _M_criticalSection[(4 *sizeof(void *)+2 *sizeof(long)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:835
scoped_lock const & operator=(const scoped_lock &)
size_t _CancelState() const
Definition: concrt.h:4506
An event type that represents the creation of an object
Definition: concrt.h:5795
virtual ~_RefCounterBase()
Definition: concrt.h:4162
RAII wrapper used to maintain and limit ppltask maximum inline schedule depth. This class will keep a...
Definition: concrt.h:5284
long _M_unpoppedChores
Definition: concrt.h:4575
_CRTIMP _In_opt_z_ const wchar_t _In_opt_z_ const wchar_t unsigned int
Definition: crtdefs.h:642
ConcRT_EventType
The types of events that can be traced using the tracing functionality offered by the Concurrency Run...
Definition: concrt.h:5595
void * _M_pTaskExtension
Definition: concrt.h:5241
_TaskCollectionStatus _ScheduleWithAutoInline(_UnrealizedChore *_PChore, _TaskInliningMode _InliningMode)
Schedule a chore with automatic inlining. The chore is pushed onto the associated workstealing queue...
Definition: concrt.h:5353
An event type that represents the act of unblocking a context.
Definition: concrt.h:5621
Definition: concrt.h:4427
long _M_recursionCount
Definition: concrt.h:882
_Scoped_lock(_NonReentrantBlockingLock &_Lock)
Definition: concrt.h:918
critical_section & _M_critical_section
Definition: concrt.h:3685
_CRTIMP event()
Constructs a new event.
volatile unsigned long EnableFlags
Definition: concrt.h:5529
_SpinWait< 0 > _SpinWaitNoYield
Definition: concrt.h:783
_CRTIMP void lock()
Acquires this critical section.
#define _Post_invalid_
Definition: sal.h:701
Concrt_TraceFlags
Trace flags for the event types
Definition: concrt.h:5773
_CRTIMP void _AcquireRead()
void _IncrementConstructedElemsCount()
Definition: concrt.h:1095
~location()
Destroys a location object.
Definition: concrt.h:1972
volatile long _M_signals
Definition: concrt.h:5429
_MallocaListHolder & operator=(const _MallocaListHolder &)
virtual ~_Chore()
Definition: concrt.h:4306
_CRTIMP unsigned int _Reference()
_ElemNodeType & operator=(const _ElemNodeType &)
_At_(this->_M_FirstNode, _Pre_valid_) virtual ~_MallocaListHolder()
Definition: concrt.h:1156
typedef void(__cdecl *_se_translator_function)(unsigned int
Definition: concrt.h:5778
_CRTIMP improper_scheduler_attach()
Constructs an improper_scheduler_attach object.
HRESULT _Hresult
Definition: concrt.h:1245
long _M_recursionCount
Definition: concrt.h:4288
static _Ty _Decrement(volatile _Ty &_Location)
Definition: concrt.h:449
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:42
Definition: concrt.h:4294
_CRTIMP invalid_multiple_scheduling()
Constructs an invalid_multiple_scheduling object.
#define _Pre_valid_
Definition: sal.h:677
location(const location &_Src)
Constructs a location object.
Definition: concrt.h:1925
_ElemType * _InitOnRawMalloca(void *_MallocaRet)
Definition: concrt.h:1085
_CONCRT_BUFFER _M_criticalSection[(4 *sizeof(void *)+2 *sizeof(long)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:938
_CRTIMP void reset()
Resets the event to a non-signaled state.
_CRTIMP 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...
A writer-preference queue-based reader-writer lock with local only spinning. The lock grants first in...
Definition: concrt.h:3730
void _Construct(_Ty1 *_Ptr, _Ty2 &&_Val)
Definition: xmemory0:37
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:5225
_CRTIMP _Context(::Concurrency::Context *_PContext=NULL)
Definition: concrt.h:381
_CRTIMP scheduler_resource_allocation_error(_In_z_ const char *_Message, HRESULT _Hresult)
Constructs a scheduler_resource_allocation_error object.
This class describes an exception thrown because of a failure to acquire a critical resource in the C...
Definition: concrt.h:1211
_CRTIMP _SpinLock(volatile long &_Flag)
~_Scoped_lock()
Definition: concrt.h:821
::Concurrency::Scheduler * _M_pScheduler
Definition: concrt.h:399
void _InternalDeleteHelper(_T *_PObject)
Definition: concrt.h:286
bool _PerformedInlineCancel() const
Definition: concrt.h:4518
#define NULL
Definition: crtdbg.h:30
_MallocaArrayHolder()
Definition: concrt.h:1071
void _Lower()
Definition: concrt.h:5469
_CRTIMP Concurrency::Scheduler * _GetScheduler()
Definition: concrt.h:396
scoped_lock_read const & operator=(const scoped_lock_read &)
volatile long _M_flags
Definition: concrt.h:5245
unsigned __int64 * PDWORD_PTR
Definition: concrt.h:117
Indicates that the location represents a paritcular execution resource.
Definition: concrt.h:2036
Definition: concrt.h:5273
Concurrency::critical_section _M_lock
Definition: concrt.h:4085
_SpinWait _SpinWaitBackoffNone
Definition: concrt.h:782
void _PrepareStealUnstructured(ContextBase *_PContext)
An event type that represents the name for an object
Definition: concrt.h:5837
void *volatile _M_pTail
Definition: concrt.h:3706
unsigned int _M_reserved
Definition: concrt.h:2138
_TaskCollectionStatus _Wait()
Waits for all chores running in the _StructuredTaskCollection to finish (normally or abnormally)...
Definition: concrt.h:4727
void * _M_pCompletionContext
Definition: concrt.h:5252
_CRTIMP void lock_read()
Acquires the reader-writer lock as a reader. If there are writers, active readers have to wait until ...
_CRTIMP context_unblock_unbalanced()
Constructs a context_unblock_unbalanced object.
void _SetRuntimeOwnsLifetime(bool fValue)
Definition: concrt.h:4347
_CONCRT_BUFFER _M_node[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3686
A non-reentrant mutex which is explicitly aware of the Concurrency Runtime.
Definition: concrt.h:3548
_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:4930
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:1962
std::exception_ptr * _M_pException
Definition: concrt.h:4587
bool _SpinOnce()
Spins for one time quantum,until a maximum spin is reached.
Definition: concrt.h:652
__declspec(noinline) static void __cdecl _StructuredChoreWrapper(_UnrealizedChore *_PChore)
_GROUP_AFFINITY * PGROUP_AFFINITY
Definition: concrt.h:52
_Condition_variable & operator=(const _Condition_variable &_Event)
_CRTIMP bool _TryAcquireWrite()
_CONCRT_BUFFER _M_lockNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:4277
int _M_stackPos
Definition: concrt.h:5249
bool _M_fRepeating
Definition: concrt.h:5520
void _Reset()
Resets the counts and state to the default.
Definition: concrt.h:741
#define _Pre_maybenull_
Definition: sal.h:687
Definition: concrt.h:5275
_CRTIMP void wait(Concurrency::critical_section &_Lck)
Waits for the _Condition_variable to become signaled. The lock argument passed in is unlocked by the ...
An event type that represents the act of a detaching from a scheduler.
Definition: concrt.h:5641
void * _CONCRT_BUFFER
Definition: concrt.h:143
_Scoped_lock(_ReaderWriterLock &_Lock)
Definition: concrt.h:991
_CRTIMP _Scheduler(::Concurrency::Scheduler *_PScheduler=NULL)
Definition: concrt.h:393
_CRTIMP ~_Condition_variable()
Destroys a _Condition_variable.
void _YieldProcessor()
Definition: concrt.h:76
_CRTIMP void set()
Signals the event.
_Scoped_lock(_ReentrantBlockingLock &_Lock)
Definition: concrt.h:815
static void __cdecl _CancelViaToken(::Concurrency::details::ContextBase *pContext)
void _Destroy(_Ty *_Ptr)
Definition: xmemory0:53
An event type that represents the conclusion of some processing
Definition: concrt.h:5807
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
#define _In_z_
Definition: sal.h:319
bool _IsCurrentlyInlined() const
Definition: concrt.h:4467
Definition: concrt.h:5775
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:5476
This class describes an exception thrown when the Attach method is called on a Scheduler object which...
Definition: concrt.h:1339
_CRTIMP void _AcquireWrite()
static _Ty _CompareAndSwap(volatile _Ty &_Location, _Ty _NewValue, _Ty _Comperand)
Definition: concrt.h:434
#define _Inout_opt_
Definition: sal.h:385
This class describes an exception thrown when an operation is performed which requires a scheduler to...
Definition: concrt.h:1313
void _PrepareSteal(ContextBase *_PContext)
_CRTIMP operation_timed_out()
Constructs an operation_timed_out object.
This class describes an exception thrown when an operation has timed out.
Definition: concrt.h:1762
This class describes an exception thrown when there are tasks still scheduled to a task_group or stru...
Definition: concrt.h:1514
Definition: concrt.h:4216
HANDLE _M_hTimer
Definition: concrt.h:5514
_TaskInliningMode
The enum defines inlining scheduling policy for ppltasks. Scheduling a chore or a functor with _TaskI...
Definition: concrt.h:5270
_SpinState _M_state
Definition: concrt.h:778
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:523
_CRTIMP void __cdecl _Trace_ppl_function(const GUID &_Guid, unsigned char _Level, ConcRT_EventType _Type)
static unsigned int _S_spinCount
Definition: concrt.h:583
This class describes an exception thrown when a task_handle object is scheduled multiple times using ...
Definition: concrt.h:1796
_CRTIMP void unlock()
Unlocks the critical section.
bool _Is_signaled() const
Definition: concrt.h:5455
~_Scoped_lock()
Definition: concrt.h:870
_ElemType _M_Elem
Definition: concrt.h:1172
critical_section & operator=(const critical_section &)
Hide assignment operator for a critical section
bool _IsEnabled(unsigned char level, unsigned long flags) const
Definition: concrt.h:5544
_CRTIMP scheduler_worker_creation_error(_In_z_ const char *_Message, HRESULT _Hresult)
Constructs a scheduler_worker_creation_error object.
_ElemNodeType * _M_Next
Definition: concrt.h:1173
#define _SAFERWLIST_SIZE
Definition: concrt.h:145
Definition: concrt.h:4425
friend class _StructuredTaskCollection
Definition: concrt.h:4386
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:777
void _RegisterConcRTEventTracing()
Register ConcRT as an ETW Event Provider.
size_t _GetAllocationSize() const
Definition: concrt.h:1127
_CRTIMP _NonReentrantPPLLock()
reader_writer_lock & _M_reader_writer_lock
Definition: concrt.h:3855
_CRTIMP native_handle_type native_handle()
Returns a platform specific native handle, if one exists.
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...
_CRTIMP bool _IsSynchronouslyBlocked() const
_SECURITY_ATTRIBUTES * LPSECURITY_ATTRIBUTES
Definition: concrt.h:49
_NonReentrantBlockingLock & _M_lock
Definition: concrt.h:929
bool _TaskCleanup()
Performs task cleanup normally done at destruction time.
Definition: concrt.h:4763
bool _ShouldSpinAgain()
Determines whether maximum spin has been reached
Definition: concrt.h:771
This class describes an exception thrown when a messaging block is unable to find a requested message...
Definition: concrt.h:1567
_CRTIMP invalid_scheduler_policy_value()
Constructs an invalid_scheduler_policy_value object.
static _CRTIMP void __cdecl _Yield()
Definition: concrt.h:5489
_In_reads_(_N) const wchar_t *_S2
_CONCRT_BUFFER _M_writerNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3856
void *volatile _M_pWaitChain
Definition: concrt.h:4153
_CRTIMP HRESULT get_error_code() const
Returns the error code that caused the exception.
_CRTIMP _Scoped_lock(_ReentrantPPLLock &_Lock)
_RefCounterBase(long _InitialCount=1)
Definition: concrt.h:4202
_Type _GetType() const
Returns the type which this location object represents.
Definition: concrt.h:2118
_CRTIMP reader_writer_lock()
Constructs a new reader_writer_lock object.
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:826
static _CRTIMP unsigned int __cdecl _Value()
An event type that marks the beginning of a start/end event pair.
Definition: concrt.h:5606
Definition: pplcancellation_token.h:104
_CRTIMP improper_scheduler_reference()
Constructs an improper_scheduler_reference object.
_Ty operator--(int)
Definition: concrt.h:531
unsigned int _GetId() const
Returns the ID which this location object represents.
Definition: concrt.h:2109
~_Scoped_lock_read()
Definition: concrt.h:1021
_TaskCollectionBase()
Definition: concrt.h:4435
An event type that represents the scheduling of a process
Definition: concrt.h:5819
Concurrency::details::_TaskCollectionBase * _M_pTaskCollection
Definition: concrt.h:4391
_CRTIMP void *__cdecl Alloc(size_t _NumBytes)
Allocates a block of memory of the size specified from the Concurrency Runtime Caching Suballocator...
void _Unlock_writer()
Called from unlock() when a writer is holding the lock. Writer unblocks the next writer in the list a...
static _CRTIMP location __cdecl _Current_node()
Returns a location representing the scheduling node that the calling thread is executing.
#define LONG_MIN
Definition: limits.h:42
Concurrency::critical_section _M_criticalSection
Definition: concrt.h:4249
_Ty operator+=(_Ty _Addend)
Definition: concrt.h:535
unsigned long _M_currentSpin
Definition: concrt.h:776
Definition: concrt.h:5780
bool _GetRuntimeOwnsLifetime() const
Definition: concrt.h:4354
TaskProc _M_completionHandler
Definition: concrt.h:5251
_TaskCollectionStatus
Definition: concrt.h:4423
_ReaderWriterLock & _M_lock
Definition: concrt.h:1004
bool _PerformedPendingCancel() const
Definition: concrt.h:4524
_CRTIMP critical_section()
Constructs a new critical section.
_TaskCollectionBaseState
Definition: concrt.h:4486
Definition: concrt.h:1169
Definition: concrt.h:5527
_CancellationTokenState * _M_pTokenState
Definition: concrt.h:4568
void _CRTIMP __cdecl _UnderlyingYield()
Default method for yielding during a spin wait
Definition: concrt.h:4319
reader_writer_lock & operator=(const reader_writer_lock &_Lock)
Hide assignment operator for a reader_writer_lock
static _CRTIMP _Scheduler __cdecl _Get()
_CRTIMP void __cdecl _ReportUnobservedException()
unsigned __int64 DWORD_PTR
Definition: concrt.h:117
_CRTIMP bool try_lock()
Tries to acquire the lock without blocking.
_CRTIMP invalid_scheduler_policy_key()
Constructs an invalid_scheduler_policy_key object.
const unsigned int COOPERATIVE_TIMEOUT_INFINITE
Value indicating that a wait should never time out.
Definition: concrt.h:3538
_Chore(TaskProc _PFunction)
Definition: concrt.h:4298
unsigned long DWORD
Definition: concrt.h:57
_ElemType * _M_ElemArray
Definition: concrt.h:1111
This class describes an exception thrown when the Unblock method of a Context object is called from t...
Definition: concrt.h:1478
_CRTIMP void _CheckTaskCollection()
_CRTIMP scoped_lock(critical_section &_Critical_section)
Constructs a scoped_lock object and acquires the critical_section object passed in the _Critical_sect...
_CRTIMP _ReaderWriterLock()
This class describes an exception thrown because of a failure to create a worker execution context in...
Definition: concrt.h:1258
~_StackGuard()
Definition: concrt.h:5292
_CRTIMP nested_scheduler_missing_detach()
Constructs a nested_scheduler_missing_detach object.
bool _M_fDetached
Definition: concrt.h:4401
An event type that represents the initiation of some processing
Definition: concrt.h:5801
void * _M_pBinding
Definition: concrt.h:2155
An event type that represents the deletion of an object
Definition: concrt.h:5813
Task collections represent groups of work which step outside the strict structuring of the _Structure...
Definition: concrt.h:4825
~_Scoped_lock()
Definition: concrt.h:997
_CRTIMP void __cdecl wait(unsigned int _Milliseconds)
Pauses the current context for a specified amount of time.
unsigned int _GetBindingId() const
Gets the binding ID for this location.
Definition: concrt.h:2127
volatile long _M_completedStolenChores
Definition: concrt.h:4578
unsigned int _CRTIMP __cdecl _GetConcurrency()
Returns the hardware concurrency available to the Concurrency Runtime, taking into account process af...
void _UnregisterConcRTEventTracing()
Unregister ConcRT as an ETW Event Provider.
_CRTIMP ~scoped_lock()
Destroys a reader_writer_lock object and releases the lock supplied in its constructor.
An event type that represents the act of a context becoming idle.
Definition: concrt.h:5631
::Concurrency::Context * _M_pContext
Definition: concrt.h:387
_In_ wctype_t _Type
Definition: ctype.h:205
unsigned int _M_type
Definition: concrt.h:2135
An abstraction of a physical location on hardware.
Definition: concrt.h:1902
Concurrency::critical_section _M_lock
Definition: concrt.h:4154
_CRTIMP bool try_lock_for(unsigned int _Timeout)
Tries to acquire the lock without blocking for a specific number of milliseconds. ...
_CRTIMP invalid_link_target()
Constructs an invalid_link_target object.
This class describes an exception thrown when the CurrentScheduler::Detach method is called on a cont...
Definition: concrt.h:1366
#define _W64
Definition: crtdefs.h:100
_Scoped_lock const & operator=(const _Scoped_lock &)
_Scoped_lock(_ReentrantLock &_Lock)
Definition: concrt.h:864
_Scoped_lock const & operator=(const _Scoped_lock &)
_ReentrantLock & _M_lock
Definition: concrt.h:875
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...
_CONCRT_BUFFER _M_activeNode[(4 *sizeof(void *)+2 *sizeof(unsigned int)+sizeof(_CONCRT_BUFFER)-1)/sizeof(_CONCRT_BUFFER)]
Definition: concrt.h:3704
_TaskCollection * _M_pNextAlias
Definition: concrt.h:5240
void _Invoke()
Definition: concrt.h:4331
_Scoped_lock const & operator=(const _Scoped_lock &)
static _Ty _Increment(volatile _Ty &_Location)
Definition: concrt.h:444
bool _Is_system() const
Internal routine that tells whether a location represents the "system location". This indicates no sp...
Definition: concrt.h:2090
static _CRTIMP void __cdecl _Oversubscribe(bool _BeginOversubscription)
Definition: concrt.h:4431
An event type that represents the act of a context yielding.
Definition: concrt.h:5626
_Scoped_lock const & operator=(const _Scoped_lock &)
bool _Acquire_lock(void *_PLockingNode, bool _FHasExternalNode)
Acquires this critical section given a specific node to lock.
void _Acquire_lock(void *_PLockingNode, bool _FHasExternalNode)
Acquires a write lock given a specific write node to lock.
_CRTIMP void __cdecl _SetUnobservedExceptionHandler(_UnobservedExceptionHandler)
This class describes an exception thrown when the Concurrency Runtime detects that you neglected to c...
Definition: concrt.h:1739
_CRTIMP void _ReleaseWrite()
_ElemType * _AddRawMallocaNode(void *_MallocaRet)
Definition: concrt.h:1147
void _Cancel()
Cancels work on the task collection.
Definition: concrt.h:5381
This class describes an exception thrown when an unsupported operating system is used.
Definition: concrt.h:1287
location()
Constructs a location object.
Definition: concrt.h:1913
_CRTIMP bad_target()
Constructs a bad_target object.
bool _M_fRuntimeOwnsLifetime
Definition: concrt.h:4398
_CRTIMP const _CONCRT_TRACE_INFO * _GetConcRTTraceInfo()
Retrieves a pointer to the internal trace flags and level information for the Concurrency runtime ETW...
An exception safe RAII wrapper that can be used to acquire reader_writer_lock lock objects as a write...
Definition: concrt.h:3834
#define _T(x)
Definition: tchar.h:2498
_CRTIMP improper_scheduler_detach()
Constructs an improper_scheduler_detach object.
reader_writer_lock & _M_reader_writer_lock
Definition: concrt.h:3888
_StackGuard()
Definition: concrt.h:5287
_CRTIMP ~scoped_lock()
Destroys a scoped_lock object and releases the critical section supplied in its constructor.
void * _M_ptr
Definition: concrt.h:2150
_CRTIMP scheduler_not_attached()
Constructs a scheduler_not_attached object.
_CRTIMP _Condition_variable()
Constructs a new _Condition_variable.
Definition: concrt.h:1041
_CRTIMP _ReentrantBlockingLock()
Definition: concrt.h:1011
static const unsigned int timeout_infinite
Value indicating that a wait should never time out.
Definition: concrt.h:4076
_CRTIMP void _Acquire(void *_Lock_node)
volatile long _M_executionStatus
The status of the task collection.
Definition: concrt.h:5231
static void _StoreWithRelease(volatile _Ty &_Location, _Ty _Rhs)
Definition: concrt.h:420
Concurrency::critical_section _M_criticalSection
Definition: concrt.h:4285
_TaskCollectionBase * _SafeGetParent()
Definition: concrt.h:4531
_MallocaArrayHolder & operator=(const _MallocaArrayHolder &)
static void _InternalFree(_UnrealizedChore *_PChore)
_CRTIMP bool __cdecl __uncaught_exception()
Definition: pplcancellation_token.h:212
volatile unsigned char EnableLevel
Definition: concrt.h:5530
virtual ~_MallocaArrayHolder()
Definition: concrt.h:1101
volatile long _M_numberOfWriters
Definition: concrt.h:1053
bool _IsStructured()
Definition: concrt.h:4473
long __cdecl _InterlockedDecrement(long volatile *)
_TaskCollection * _M_pOriginalCollection
Definition: concrt.h:5239
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:4084
Definition: concrt.h:1042
_Type
Describes the type of the given location.
Definition: concrt.h:2016
_State
Definition: concrt.h:1039
_CRTIMP ~scoped_lock_read()
Destroys a scoped_lock_read object and releases the lock supplied in its constructor.
void _SetDetached(bool _FDetached)
void _DoYield()
Yields its time slice using the specified yieldFunciton
Definition: concrt.h:723
long _Release()
Definition: concrt.h:4180
_Diff _Count
Definition: algorithm:1941
volatile long _M_chaining
Definition: concrt.h:5246
Definition: concrt.h:5777
_Ty operator++()
Definition: concrt.h:519
Indicates that the location represents the "system location". This has no specific affinity...
Definition: concrt.h:2021
An exception safe RAII wrapper that can be used to acquire reader_writer_lock lock objects as a reade...
Definition: concrt.h:3866
void *volatile _M_pWaitChain
Definition: concrt.h:4083
void * _M_pWriterHead
Definition: concrt.h:3958
_CRTIMP void _Acquire(void *_Lock_node)
size_t & _Depth
Definition: concrt.h:5305
unsigned long _NumberOfSpins()
Determines the current spin count
Definition: concrt.h:759
_ReentrantPPLLock & _M_lock
Definition: concrt.h:4276
_CRTIMP void unlock()
Unlocks the reader-writer lock based on who locked it, reader or writer.
volatile long _M_refCount
Definition: concrt.h:4208
This class describes an exception thrown when the Scheduler::SetDefaultSchedulerPolicy method is call...
Definition: concrt.h:1419
volatile _Ty _M_value
Definition: concrt.h:499
_ElemNodeType * _M_FirstNode
Definition: concrt.h:1182
Definition: concrt.h:4266
void _Initialize(_ElemType *_Elem)
Definition: concrt.h:1074
_Chore()
Definition: concrt.h:4302
A manual reset event which is explicitly aware of the Concurrency Runtime.
Definition: concrt.h:3982
_CRT_MANAGED_FP_DEPRECATE _In_ unsigned int _Mask
Definition: float.h:120
virtual ~_UnrealizedChore()
Definition: concrt.h:4327
void _SetSpinCount(unsigned int _Count)
Set a dynamic spin count.
Definition: concrt.h:624
Definition: concrt.h:1067
long __cdecl _InterlockedIncrement(long volatile *)
unsigned int _M_id
Definition: concrt.h:2147
static _Ty _FetchAndAdd(volatile _Ty &_Location, _Ty _Addend)
Definition: concrt.h:439
This class describes an exception thrown when a policy key of a SchedulerPolicy object is set to an i...
Definition: concrt.h:1650
void _EnableTrace(unsigned char level, unsigned long flags)
Definition: concrt.h:5532
_Scoped_lock_read(_ReaderWriterLock &_Lock)
Definition: concrt.h:1015
An exception safe RAII wrapper for a critical_section object.
Definition: concrt.h:3661
event & operator=(const event &_Event)
const size_t COOPERATIVE_WAIT_TIMEOUT
Value indicating that a wait timed out.
Definition: concrt.h:3529
bool _IsAbnormalExit() const
Definition: concrt.h:4500
_CRTIMP missing_wait()
Constructs a missing_wait object.
bool operator==(const location &_Rhs) const
Determines whether two location objects represent the same location.
Definition: concrt.h:1983
#define SIZE_MAX
Definition: limits.h:81
_CRTIMP void _ReleaseRead()
_CRTIMP bool _TryAcquire()
_CRTIMP void notify_one()
Notify a single waiter of the _Condition_variable.
Internal maintainence structure for beacons.
Definition: concrt.h:5427
Definition: concrt.h:5782
volatile long _M_state
Definition: concrt.h:1048
_Ty _CompareAndSwap(_Ty _NewValue, _Ty _Comperand)
Definition: concrt.h:511
_Check_return_ _In_ long _Size
Definition: io.h:325
_CRTIMP void __cdecl _Trace_agents(Agents_EventType _Type, __int64 agentId,...)
An event type that represents the act of a context blocking.
Definition: concrt.h:5616
static _CRTIMP _Context __cdecl _CurrentContext()
_CRTIMP bool try_lock_read()
Attempts to acquire the reader-writer lock as a reader without blocking.
unsigned int _M_bindingId
Definition: concrt.h:2141
_StructuredTaskCollection()
Construct a new structured task collection.
Definition: concrt.h:4628
static _CRTIMP 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.
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:3956
long __cdecl _InterlockedCompareExchange(long volatile *, long, long)
_MallocaListHolder()
Definition: concrt.h:1132
static void __cdecl _InvokeBridge(void *_PContext)
Definition: concrt.h:4375
virtual void _Destroy()
Definition: concrt.h:4196
void * _M_pWriterTail
Definition: concrt.h:3959
_CRTIMP void notify_all()
Notify all the waiters of the _Condition_variable.
char * va_list
Definition: crtdefs.h:550
_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:4241
void * HANDLE
Definition: concrt.h:66
_CRTIMP _ReentrantPPLLock()
static _CRTIMP unsigned int __cdecl _Id()
event _M_event
An event on which to wait for stolen chores to complete.
Definition: concrt.h:5237
Definition: concrt.h:5776
static _CRTIMP unsigned int __cdecl _GetNumberOfVirtualProcessors()
_CRTIMP 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...
_CRTIMP ~critical_section()
Destroys a critical section.
_CRTIMP 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...
volatile long _M_lockState
Definition: concrt.h:3960
Definition: concrt.h:4230
A _Condition_variable which is explicitly aware of the Concurrency Runtime.
Definition: concrt.h:4094
volatile long _M_owner
Definition: concrt.h:883
void * _OwningContext() const
Definition: concrt.h:4455
static _ChoreType * _InternalAlloc(const _Function &_Func)
Definition: concrt.h:4361
This class describes an exception thrown when the Context::Oversubscribe method is called with the _B...
Definition: concrt.h:1822
_SpinState
State of the spin wait class.
Definition: concrt.h:710
_Ty operator--()
Definition: concrt.h:527