Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / Scheduling / QueryTask.cs / 1305376 / QueryTask.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// QueryTask.cs
//
// [....]
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System.Threading;
using System.Threading.Tasks;
using System.Diagnostics.Contracts;
namespace System.Linq.Parallel
{
// To disable exception marshaling (e.g. for debugging purposes), uncomment this symbol
// or recompile PLINQ passing the symbol on the cmd-line, i.e. csc.exe ... /d:LET_...
//#define LET_ASYNC_EXCEPTIONS_CRASH
///
/// Simple abstract task representation, allowing either synchronous and asynchronous
/// execution. Subclasses override the Work API to implement the logic.
///
internal abstract class QueryTask
{
protected int m_taskIndex; // The unique id of this task.
protected QueryTaskGroupState m_groupState; // State shared among the tasks.
//------------------------------------------------------------------------------------
// Constructs a new task with the specified shared state.
//
protected QueryTask(int taskIndex, QueryTaskGroupState groupState)
{
Contract.Assert(groupState != null);
m_taskIndex = taskIndex;
m_groupState = groupState;
}
//-----------------------------------------------------------------------------------
// A static function used by s_runTaskSynchronouslyDelegate, which is used by RunSynchronously
//
private static void RunTaskSynchronously(object o)
{
((QueryTask)o).BaseWork(null);
}
//-----------------------------------------------------------------------------------
// A static delegate used by RunSynchronously
//
private static Action
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SystemBrushes.cs
- NaturalLanguageHyphenator.cs
- ErasingStroke.cs
- FixedDocumentPaginator.cs
- Column.cs
- DetailsViewDeletedEventArgs.cs
- ExpressionPrinter.cs
- SecureConversationServiceElement.cs
- GenerateDerivedKeyRequest.cs
- HttpWebResponse.cs
- WindowPattern.cs
- MiniAssembly.cs
- RefType.cs
- PriorityQueue.cs
- SystemGatewayIPAddressInformation.cs
- FrameworkTemplate.cs
- ErrorFormatter.cs
- InvokeMethod.cs
- OlePropertyStructs.cs
- ScrollItemPattern.cs
- CheckoutException.cs
- TabletDevice.cs
- DataGridItem.cs
- XmlElementAttributes.cs
- FrameworkContentElementAutomationPeer.cs
- WinFormsComponentEditor.cs
- ellipse.cs
- ObjectDataSourceFilteringEventArgs.cs
- BindingExpressionUncommonField.cs
- SecurityState.cs
- DataServiceHostFactory.cs
- TrackingProfile.cs
- SchemaComplexType.cs
- ControlValuePropertyAttribute.cs
- Permission.cs
- DelimitedListTraceListener.cs
- TypedDatasetGenerator.cs
- ObjectComplexPropertyMapping.cs
- InputLanguageManager.cs
- CommonDialog.cs
- BindingObserver.cs
- XsltArgumentList.cs
- TextEndOfSegment.cs
- BeginStoryboard.cs
- AttributeExtensions.cs
- DataService.cs
- LinkLabel.cs
- NonceCache.cs
- ButtonBaseAdapter.cs
- FixedPage.cs
- BrowserCapabilitiesCodeGenerator.cs
- ParserExtension.cs
- AuthenticatingEventArgs.cs
- SafeCryptHandles.cs
- PostBackOptions.cs
- BindingManagerDataErrorEventArgs.cs
- TableStyle.cs
- StreamGeometry.cs
- ErrorEventArgs.cs
- DataSourceCacheDurationConverter.cs
- NamespaceEmitter.cs
- ReadOnlyPropertyMetadata.cs
- TextBounds.cs
- UICuesEvent.cs
- WindowsContainer.cs
- XmlFormatWriterGenerator.cs
- HtmlEmptyTagControlBuilder.cs
- DynamicPropertyReader.cs
- Claim.cs
- RegisteredDisposeScript.cs
- SqlDataRecord.cs
- DrawingCollection.cs
- NativeWindow.cs
- EditorOptionAttribute.cs
- ParseHttpDate.cs
- MethodBody.cs
- ParameterBuilder.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ItemsPresenter.cs
- Thumb.cs
- FileLevelControlBuilderAttribute.cs
- Tablet.cs
- ListControl.cs
- DeviceSpecificChoiceCollection.cs
- PerfCounters.cs
- ProcessInfo.cs
- TraversalRequest.cs
- RightsManagementUser.cs
- WebPartDescription.cs
- XmlElementCollection.cs
- SmiRequestExecutor.cs
- FileInfo.cs
- ControlOperationBehavior.cs
- BlobPersonalizationState.cs
- Vector3DCollectionConverter.cs
- SelectedGridItemChangedEvent.cs
- StatementContext.cs
- OptionUsage.cs
- MDIWindowDialog.cs
- EdmRelationshipRoleAttribute.cs