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
- Trace.cs
- LiteralControl.cs
- DisplayInformation.cs
- MediaTimeline.cs
- ClientSettingsProvider.cs
- XmlReflectionMember.cs
- BaseCollection.cs
- XPathSelfQuery.cs
- QuaternionAnimationUsingKeyFrames.cs
- MessagePropertyDescriptionCollection.cs
- XmlNodeList.cs
- WebPartsPersonalization.cs
- BitmapDecoder.cs
- ProfileBuildProvider.cs
- TemplatedEditableDesignerRegion.cs
- CatalogZoneBase.cs
- TransportChannelListener.cs
- HotSpot.cs
- QueryMatcher.cs
- TextTreePropertyUndoUnit.cs
- GiveFeedbackEvent.cs
- RewritingSimplifier.cs
- CustomSignedXml.cs
- ContentPosition.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- ApplicationServiceHelper.cs
- RequestStatusBarUpdateEventArgs.cs
- HttpCapabilitiesSectionHandler.cs
- Delegate.cs
- UserInitiatedNavigationPermission.cs
- TypeProvider.cs
- DummyDataSource.cs
- ToolStripSplitButton.cs
- OdbcTransaction.cs
- WebPartCloseVerb.cs
- NameValuePermission.cs
- AbstractSvcMapFileLoader.cs
- ModelMemberCollection.cs
- CodeCommentStatementCollection.cs
- BooleanStorage.cs
- HtmlPanelAdapter.cs
- FormViewInsertedEventArgs.cs
- TreeNodeClickEventArgs.cs
- SafeEventLogWriteHandle.cs
- DynamicPropertyReader.cs
- ProfileGroupSettingsCollection.cs
- WebPartConnectionsCancelVerb.cs
- DebugView.cs
- XmlWrappingWriter.cs
- ListSortDescriptionCollection.cs
- SearchExpression.cs
- DropShadowEffect.cs
- Stack.cs
- XmlArrayItemAttribute.cs
- GeometryHitTestParameters.cs
- AnnotationComponentChooser.cs
- HttpApplicationFactory.cs
- DataProtection.cs
- IdnElement.cs
- EditorZone.cs
- XmlSchemaCompilationSettings.cs
- UnsafeNativeMethods.cs
- PbrsForward.cs
- XmlDocumentType.cs
- ListControl.cs
- DesignerForm.cs
- IdlingCommunicationPool.cs
- Simplifier.cs
- PagePropertiesChangingEventArgs.cs
- CompilerCollection.cs
- FilePresentation.cs
- XPathDescendantIterator.cs
- ByteBufferPool.cs
- PaperSource.cs
- UpdateException.cs
- ScriptControlManager.cs
- DiscoveryClientReferences.cs
- WorkflowInvoker.cs
- ProcessInfo.cs
- RuntimeEnvironment.cs
- Variant.cs
- XmlILAnnotation.cs
- TakeQueryOptionExpression.cs
- DataGridViewUtilities.cs
- RegexCapture.cs
- Random.cs
- PriorityQueue.cs
- SiteMapPath.cs
- TextBounds.cs
- XmlUnspecifiedAttribute.cs
- ElapsedEventArgs.cs
- ExtenderProvidedPropertyAttribute.cs
- FrameworkContextData.cs
- ReadOnlyAttribute.cs
- SqlVisitor.cs
- MessagePartSpecification.cs
- ListenerAdaptersInstallComponent.cs
- TextTrailingWordEllipsis.cs
- CTreeGenerator.cs
- SetterTriggerConditionValueConverter.cs