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
- Selection.cs
- DriveInfo.cs
- BamlBinaryWriter.cs
- SafeFileHandle.cs
- Rectangle.cs
- Util.cs
- CatalogZoneDesigner.cs
- CrossAppDomainChannel.cs
- IFlowDocumentViewer.cs
- BindingManagerDataErrorEventArgs.cs
- DescendantQuery.cs
- PaintValueEventArgs.cs
- SQLConvert.cs
- ClientSettingsProvider.cs
- SqlProvider.cs
- TransformerTypeCollection.cs
- Baml2006KnownTypes.cs
- WebUtil.cs
- InteropBitmapSource.cs
- WaitHandleCannotBeOpenedException.cs
- PathFigureCollection.cs
- SimpleRecyclingCache.cs
- GridSplitterAutomationPeer.cs
- Rijndael.cs
- GregorianCalendar.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- CodeMemberProperty.cs
- ReflectEventDescriptor.cs
- OpacityConverter.cs
- XmlReader.cs
- SmiContextFactory.cs
- FixedDocument.cs
- StyleTypedPropertyAttribute.cs
- TdsRecordBufferSetter.cs
- HttpChannelBindingToken.cs
- PageAsyncTaskManager.cs
- ExtensionFile.cs
- SqlColumnizer.cs
- DetailsViewRow.cs
- PrintPreviewDialog.cs
- HttpConfigurationSystem.cs
- ViewPort3D.cs
- CursorConverter.cs
- EmptyElement.cs
- AsmxEndpointPickerExtension.cs
- RtfToken.cs
- PreviewKeyDownEventArgs.cs
- HWStack.cs
- AddressUtility.cs
- XmlRootAttribute.cs
- LongValidatorAttribute.cs
- PrincipalPermission.cs
- TypedRowHandler.cs
- HitTestWithGeometryDrawingContextWalker.cs
- LinkUtilities.cs
- AccessDataSourceWizardForm.cs
- HtmlInputFile.cs
- FixedSOMLineCollection.cs
- QuadraticBezierSegment.cs
- _AutoWebProxyScriptEngine.cs
- sqlstateclientmanager.cs
- ClientSettings.cs
- ExpressionEditor.cs
- ThreadStartException.cs
- IOThreadTimer.cs
- MbpInfo.cs
- DecimalAnimation.cs
- AlignmentYValidation.cs
- IIS7UserPrincipal.cs
- DocumentViewerConstants.cs
- SimpleHandlerFactory.cs
- ScrollViewer.cs
- BulletedListEventArgs.cs
- PanningMessageFilter.cs
- AVElementHelper.cs
- CustomWebEventKey.cs
- WsatTransactionInfo.cs
- BinarySecretKeyIdentifierClause.cs
- SplineKeyFrames.cs
- SqlXmlStorage.cs
- DataGridViewTopLeftHeaderCell.cs
- TypefaceCollection.cs
- TabletDevice.cs
- CustomWebEventKey.cs
- WeakEventManager.cs
- NumberFormatInfo.cs
- DBSqlParser.cs
- GB18030Encoding.cs
- TraceSection.cs
- DbConnectionInternal.cs
- _NtlmClient.cs
- ImageInfo.cs
- SQLSingle.cs
- SchemaObjectWriter.cs
- RenamedEventArgs.cs
- IconConverter.cs
- TypeUtils.cs
- HwndSource.cs
- TableLayoutPanelCodeDomSerializer.cs
- ThreadExceptionEvent.cs