واجهة ICLRTask
Provides وظائف that allow the مضيف إلى make requests of the وقت تشغيل اللغة العامة (CLR), أو إلى provide إعلام إلى the CLR حول the associated مهمة.
interface ICLRTask : IUnknown {
HRESULT Abort ();
HRESULT ExitTask ();
HRESULT GetMemStats (
[out] COR_GC_THREAD_STATS *pMemUsage
);
HRESULT LocksHeld (
[out] SIZE_T *pLockCount
);
HRESULT NeedsPriorityScheduling (
[out] BOOL *pbNeedsPriorityScheduling
);
HRESULT Reset (
[in] BOOL fFull
);
HRESULT RudeAbort ();
HRESULT SetTaskIdentifier (
[in] DWORD asked
);
HRESULT SwitchIn (
[in] HANDLE threadHandle
);
HRESULT SwitchOut ();
HRESULT YieldTask ();
}
الأساليب
Method |
الوصف |
---|---|
Requests that the CLR إيقاف قبل الاكتمال the مهمة that the الحالي ICLRTask مثيل represents. |
|
Notifies the CLR that the مهمة associated مع the الحالي ICLRTask مثيل هو الإنهاء, و attempts إلى shut the مهمة أسفل gracefully. |
|
Gets statistical معلومات تشغيل the استخدم of ذاكرة موارد بواسطة the مهمة represented بواسطة the الحالي ICLRTask مثيل. |
|
Gets the رقم of locks currently held تشغيل the مهمة. |
|
Gets a القيمة indicating whether the مضيف should تعيين a عالي أولوية إلى rescheduling the مهمة represented بواسطة the الحالي ICLRTask مثيل. |
|
Informs the CLR that the مضيف has مكتمل a مهمة, و enables the CLR إلى reuse the الحالي ICLRTask مثيل إلى represent another مهمة. |
|
Causes the CLR إلى إيقاف قبل الاكتمال the مهمة represented بواسطة the الحالي ICLRTask مثيل immediately, without a guarantee that finalizers will be executed. |
|
Sets a معرّف فريد for the مهمة represented بواسطة the الحالي ICLRTask مثيل, for استخدم في تصحيح الأخطاء. |
|
Notifies the CLR that the مهمة represented بواسطة the الحالي ICLRTask مثيل هو في an operable الولاية. |
|
قم بإعلام CLR المهمة ممثلة الحالي ICLRTaskمثيل هو لم يعد في حالة operable. |
|
Requests that the CLR make processor الوقت متوفر إلى غير ذلك tasks. The CLR makes لا guarantee that the مهمة will be put في a الولاية الموقع it can yield processing الوقت. |
ملاحظات
An ICLRTask هو the representation of a مهمة for the CLR. At أي يؤشر during تعليمات برمجية execution, a مهمة can be described either كـ running أو جارى الإنتظار إلى تشغيل. The مضيف calls the ICLRTask::SwitchIn أسلوب إلى notify the CLR that the مهمة that the الحالي ICLRTask مثيل represents هو now في an operable الولاية. بعد استدعاء ICLRTask::SwitchIn، يمكن للمضيف جدولة المهمة في أي نظام تشغيل مؤشر ترابط، فيما عدا في الحالات حيث تتطلب وقت التشغيل لمؤشر الترابط-تقارب، كما هو محدد بالمكالمات IمضيفمهمةManager::Begفيمؤشر ترابطAffفيity وأساليب IمضيفمهمةManager::Endمؤشر ترابطAffفيity . Some الوقت later, the operating النظام might decide إلى إزالة the مهمة من the مؤشر ترابط و place it في a non-تشغيل الولاية. For مثال, this might happen whenever the مهمة blocks تشغيل المزامنة primitives, أو waits for I/O العمليات إلى إكمال. The مضيف calls SwitchOut إلى notify the CLR that the مهمة represented بواسطة the الحالي ICLRTask مثيل غير محقق longer في an operable الولاية.
A مهمة typically terminates at the إنهاء of تعليمات برمجية execution. At that الوقت, the مضيف calls ICLRTask::ExitTask إلى destroy the associated ICLRTask. However, tasks can also be recycled بواسطة using a يتصل إلى ICLRTask::Reset, which allows the ICLRTask مثيل إلى be used again. This approach prevents the زائد عن الحد of repeatedly creating و destroying instances.
المتطلبات
الأنظمة الأساسية: See متطلبات النظام إطار عمل .NET.
**Header:**MSCorEE.idl
**المكتبة:**مُضمن كـ مورد في MSCorEE.dll
.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0