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
- DiscardableAttribute.cs
- QueryContinueDragEvent.cs
- SamlConditions.cs
- SkipQueryOptionExpression.cs
- Knowncolors.cs
- GB18030Encoding.cs
- SmtpCommands.cs
- DataGridViewAutoSizeModeEventArgs.cs
- RoleServiceManager.cs
- ColorMatrix.cs
- EncoderFallback.cs
- AdornerHitTestResult.cs
- MaskDescriptors.cs
- EditorPartChrome.cs
- InputReportEventArgs.cs
- Menu.cs
- ILGenerator.cs
- ErrorEventArgs.cs
- NaturalLanguageHyphenator.cs
- NegationPusher.cs
- SynchronizedInputPattern.cs
- LocalTransaction.cs
- CompressedStack.cs
- MethodBuilder.cs
- HtmlMobileTextWriter.cs
- BuildProvidersCompiler.cs
- ConnectionStringSettingsCollection.cs
- CacheMemory.cs
- EpmCustomContentSerializer.cs
- SqlCacheDependency.cs
- serverconfig.cs
- COM2FontConverter.cs
- CodeSnippetExpression.cs
- DeviceContexts.cs
- CompilationUnit.cs
- TypeHelpers.cs
- formatter.cs
- LinkedResource.cs
- DictionaryKeyPropertyAttribute.cs
- TypedDatasetGenerator.cs
- LocalizedNameDescriptionPair.cs
- recordstate.cs
- ValidatorCompatibilityHelper.cs
- ToolStripPanelRenderEventArgs.cs
- DataGridViewComboBoxColumn.cs
- Vector3DIndependentAnimationStorage.cs
- ProtocolsConfigurationHandler.cs
- PropertyStore.cs
- DSASignatureFormatter.cs
- SHA1Managed.cs
- MailMessage.cs
- RoleManagerSection.cs
- XpsFilter.cs
- RuleProcessor.cs
- SqlRecordBuffer.cs
- Span.cs
- COAUTHINFO.cs
- RawTextInputReport.cs
- KeyboardEventArgs.cs
- AnnotationResourceCollection.cs
- ReturnValue.cs
- XmlAnyElementAttributes.cs
- Hashtable.cs
- ProviderConnectionPointCollection.cs
- ExeContext.cs
- DataTable.cs
- SystemNetHelpers.cs
- EntityProviderFactory.cs
- COAUTHINFO.cs
- FixedTextPointer.cs
- DataRecordInternal.cs
- Collection.cs
- BamlMapTable.cs
- NativeMethods.cs
- InternalException.cs
- Accessible.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- HMACSHA256.cs
- HandlerBase.cs
- RegexParser.cs
- XmlNodeChangedEventManager.cs
- XmlSchemaExporter.cs
- AlternationConverter.cs
- MimeBasePart.cs
- TreeNodeSelectionProcessor.cs
- TraceHwndHost.cs
- ReflectionServiceProvider.cs
- IPAddressCollection.cs
- SmiEventStream.cs
- AutoGeneratedField.cs
- Vector3DConverter.cs
- NullableDoubleSumAggregationOperator.cs
- CacheChildrenQuery.cs
- XmlMembersMapping.cs
- ExternalFile.cs
- ChildrenQuery.cs
- SqlClientMetaDataCollectionNames.cs
- XhtmlTextWriter.cs
- HitTestFilterBehavior.cs
- TypeDescriptor.cs