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
- TreeViewAutomationPeer.cs
- ClientSideQueueItem.cs
- ServiceEndpoint.cs
- smtpconnection.cs
- XmlDictionary.cs
- ServiceNotStartedException.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- EnlistmentState.cs
- InertiaExpansionBehavior.cs
- WsdlWriter.cs
- DefaultTextStore.cs
- DesignOnlyAttribute.cs
- OleDbConnectionInternal.cs
- GridViewHeaderRowPresenter.cs
- ConsumerConnectionPoint.cs
- PeerApplication.cs
- VirtualPathProvider.cs
- Vector3DAnimation.cs
- AutoScrollExpandMessageFilter.cs
- CommonDialog.cs
- TextWriterEngine.cs
- SpecialTypeDataContract.cs
- IisTraceListener.cs
- DispatcherTimer.cs
- QilSortKey.cs
- Opcode.cs
- EnumValAlphaComparer.cs
- hebrewshape.cs
- TimeIntervalCollection.cs
- InternalBase.cs
- XsdDateTime.cs
- Vector3DAnimationUsingKeyFrames.cs
- IList.cs
- UnregisterInfo.cs
- SpellerHighlightLayer.cs
- TcpTransportElement.cs
- QilTargetType.cs
- UTF7Encoding.cs
- InstallerTypeAttribute.cs
- RegisteredHiddenField.cs
- ThreadAbortException.cs
- BaseDataBoundControl.cs
- SystemIcons.cs
- Page.cs
- MaterialCollection.cs
- CacheMemory.cs
- WebPartRestoreVerb.cs
- XamlPoint3DCollectionSerializer.cs
- PersonalizableTypeEntry.cs
- DataColumnMapping.cs
- SettingsPropertyValueCollection.cs
- MediaCommands.cs
- TypeInfo.cs
- IdentityHolder.cs
- TextRangeSerialization.cs
- CacheDependency.cs
- WebServiceData.cs
- PageContentCollection.cs
- QilDataSource.cs
- CommandDesigner.cs
- UIElementParagraph.cs
- XsdBuilder.cs
- CodeObjectCreateExpression.cs
- MailWriter.cs
- XmlAnyAttributeAttribute.cs
- EllipseGeometry.cs
- UiaCoreApi.cs
- IChannel.cs
- GifBitmapEncoder.cs
- dtdvalidator.cs
- SelectionItemProviderWrapper.cs
- DBSchemaTable.cs
- AssociativeAggregationOperator.cs
- ToolStripDropDown.cs
- ShapingWorkspace.cs
- TextDecorationLocationValidation.cs
- SystemIPAddressInformation.cs
- SqlClientFactory.cs
- SelectionRangeConverter.cs
- EditorZone.cs
- EdmComplexPropertyAttribute.cs
- PenLineCapValidation.cs
- XmlLanguageConverter.cs
- CqlParserHelpers.cs
- CounterSetInstanceCounterDataSet.cs
- Vector3DCollection.cs
- Decimal.cs
- DetailsViewDeleteEventArgs.cs
- GeometryConverter.cs
- DataBoundControl.cs
- DocumentApplicationJournalEntryEventArgs.cs
- UnsafeNativeMethods.cs
- SmiGettersStream.cs
- XhtmlBasicSelectionListAdapter.cs
- SQLByteStorage.cs
- RegexCaptureCollection.cs
- DeclarativeCatalogPart.cs
- SqlClientPermission.cs
- EncryptedPackage.cs
- Stylesheet.cs