Code:
/ 4.0 / 4.0 / untmp / 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
- TreeViewHitTestInfo.cs
- Renderer.cs
- HttpCapabilitiesEvaluator.cs
- NameValueConfigurationCollection.cs
- XmlDataSourceDesigner.cs
- ClientTargetCollection.cs
- SQLDecimal.cs
- SignedXmlDebugLog.cs
- AppSettingsReader.cs
- ProvideValueServiceProvider.cs
- MetadataCollection.cs
- Polygon.cs
- WebServiceEndpoint.cs
- XmlNamedNodeMap.cs
- Group.cs
- DbConnectionOptions.cs
- SecurityHeaderTokenResolver.cs
- AutomationPropertyInfo.cs
- WebPartHeaderCloseVerb.cs
- ConnectionPoint.cs
- SqlCaseSimplifier.cs
- ComplexTypeEmitter.cs
- DataControlHelper.cs
- CalendarDay.cs
- CustomErrorsSectionWrapper.cs
- mongolianshape.cs
- QilLoop.cs
- EventHandlerList.cs
- TypeSystem.cs
- ListViewSelectEventArgs.cs
- BulletedList.cs
- _SSPISessionCache.cs
- ListBindingConverter.cs
- ToolStripMenuItem.cs
- Effect.cs
- StateDesigner.LayoutSelectionGlyph.cs
- PropertyConverter.cs
- WebDisplayNameAttribute.cs
- updatecommandorderer.cs
- BinaryObjectWriter.cs
- TraceContextRecord.cs
- JsonFormatWriterGenerator.cs
- HandleCollector.cs
- StrokeCollection.cs
- SqlConnectionManager.cs
- DiscoveryMessageSequence.cs
- MD5.cs
- InterleavedZipPartStream.cs
- ClrProviderManifest.cs
- ApplicationSettingsBase.cs
- FunctionParameter.cs
- SqlInfoMessageEvent.cs
- EntityKey.cs
- FontInfo.cs
- TabPanel.cs
- EventSetter.cs
- ImmutableObjectAttribute.cs
- WorkflowTerminatedException.cs
- Internal.cs
- ServiceReference.cs
- Double.cs
- WeakReferenceList.cs
- OutputWindow.cs
- MemoryStream.cs
- WebPartConnectionsEventArgs.cs
- precedingsibling.cs
- OneOf.cs
- WinFormsUtils.cs
- CodeSubDirectory.cs
- ResolveCompletedEventArgs.cs
- HttpChannelHelper.cs
- AVElementHelper.cs
- SafeNativeMethods.cs
- Token.cs
- XmlDataSourceNodeDescriptor.cs
- Error.cs
- DocumentViewerAutomationPeer.cs
- SplitterPanelDesigner.cs
- HtmlGenericControl.cs
- BitStream.cs
- SqlClientMetaDataCollectionNames.cs
- DbExpressionBuilder.cs
- CodeSnippetExpression.cs
- LeafCellTreeNode.cs
- UnionCqlBlock.cs
- HtmlInputControl.cs
- ErrorHandlingAcceptor.cs
- MultipleViewProviderWrapper.cs
- UnicastIPAddressInformationCollection.cs
- XPathBuilder.cs
- HuffModule.cs
- FileDialogCustomPlace.cs
- ColorTransformHelper.cs
- PathSegmentCollection.cs
- ValueTable.cs
- WhereQueryOperator.cs
- Faults.cs
- BlurEffect.cs
- CompatibleComparer.cs
- DataGridViewSortCompareEventArgs.cs