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
- DispatchChannelSink.cs
- CustomCredentialPolicy.cs
- BaseValidator.cs
- OutputCacheSettingsSection.cs
- DecoderExceptionFallback.cs
- ProjectionCamera.cs
- StylusPointCollection.cs
- HtmlLink.cs
- XmlSerializerSection.cs
- InkCanvasFeedbackAdorner.cs
- CodeAssignStatement.cs
- ParallelForEach.cs
- ReadOnlyCollectionBase.cs
- ConditionBrowserDialog.cs
- ObjectDataSourceMethodEventArgs.cs
- EntityViewGenerationAttribute.cs
- MenuItemStyleCollection.cs
- UnsettableComboBox.cs
- Style.cs
- BindingList.cs
- ParameterModifier.cs
- DataControlCommands.cs
- WebRequestModuleElement.cs
- SerialPinChanges.cs
- BinaryReader.cs
- ColumnCollection.cs
- XpsFilter.cs
- FrameworkElementFactoryMarkupObject.cs
- SettingsBindableAttribute.cs
- MsmqTransportElement.cs
- HtmlTernaryTree.cs
- AttributedMetaModel.cs
- ButtonPopupAdapter.cs
- XmlAnyElementAttributes.cs
- ClusterSafeNativeMethods.cs
- ThemeConfigurationDialog.cs
- NamespaceInfo.cs
- SoapAttributeOverrides.cs
- PolyBezierSegment.cs
- ToolboxDataAttribute.cs
- DbConnectionPoolCounters.cs
- CodeBlockBuilder.cs
- RuntimeConfig.cs
- DesignerActionGlyph.cs
- LineUtil.cs
- EastAsianLunisolarCalendar.cs
- DataGridViewDataErrorEventArgs.cs
- Point3DCollection.cs
- BuilderPropertyEntry.cs
- WebPartAddingEventArgs.cs
- CollectionBuilder.cs
- FileDialog.cs
- BuildProviderAppliesToAttribute.cs
- SimpleColumnProvider.cs
- ManagementScope.cs
- x509utils.cs
- Group.cs
- listitem.cs
- COM2PictureConverter.cs
- ContourSegment.cs
- RepeatBehaviorConverter.cs
- PageHandlerFactory.cs
- URIFormatException.cs
- ServiceNameElementCollection.cs
- CallTemplateAction.cs
- DoubleUtil.cs
- SerializeAbsoluteContext.cs
- AttributeTable.cs
- ErrorTableItemStyle.cs
- SystemException.cs
- DeflateEmulationStream.cs
- TextEditorSpelling.cs
- BaseParser.cs
- Automation.cs
- BrowserDefinitionCollection.cs
- BitmapFrameDecode.cs
- ManageRequest.cs
- X509Chain.cs
- FontStyleConverter.cs
- WebContentFormatHelper.cs
- CodeAttributeArgument.cs
- ThrowOnMultipleAssignment.cs
- ServiceParser.cs
- EventLogConfiguration.cs
- ComplexBindingPropertiesAttribute.cs
- SystemKeyConverter.cs
- DataObjectMethodAttribute.cs
- ColorConvertedBitmap.cs
- PrtCap_Public.cs
- SqlCrossApplyToCrossJoin.cs
- TreeViewDesigner.cs
- ParameterToken.cs
- VarInfo.cs
- XmlDataContract.cs
- Certificate.cs
- SafeHandles.cs
- ExtensionSurface.cs
- TemplatedMailWebEventProvider.cs
- BoundingRectTracker.cs
- Funcletizer.cs