Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / System.Runtime.DurableInstancing / System / Runtime / DurableInstancing / InstanceHandleReference.cs / 1305376 / InstanceHandleReference.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Runtime.DurableInstancing { // This class serves as a reference back to an InstanceHandle from the perspective of an InstanceOwner for tracking lock binds in progress. // It works in two modes, one as a pure cancelable handle reference (where cancelling means nulling out the reference) and the // other as a queue position marker for determining when all of the in-progress requests at one point in time are all done. In the // marker mode (InstanceOwner.LockResolutionMarker), it carries some additional context for maintaining the state of the // InstancePersistenceContext.ResolveExistingLock operation. class InstanceHandleReference { internal InstanceHandleReference(InstanceHandle instanceHandle) { Fx.Assert(instanceHandle != null, "Null instanceHandle provided to InstanceHandleReference."); InstanceHandle = instanceHandle; } // This is set to null when the InstanceHandleReference is detached from the InstanceHandle - i.e. it is // no longer in use, and exists just to make it possible to lazily drain out of the various queues. internal InstanceHandle InstanceHandle { get; private set; } internal void Cancel() { Fx.Assert(InstanceHandle != null, "InstanceHandleReference already cancelled."); InstanceHandle = null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Runtime.DurableInstancing { // This class serves as a reference back to an InstanceHandle from the perspective of an InstanceOwner for tracking lock binds in progress. // It works in two modes, one as a pure cancelable handle reference (where cancelling means nulling out the reference) and the // other as a queue position marker for determining when all of the in-progress requests at one point in time are all done. In the // marker mode (InstanceOwner.LockResolutionMarker), it carries some additional context for maintaining the state of the // InstancePersistenceContext.ResolveExistingLock operation. class InstanceHandleReference { internal InstanceHandleReference(InstanceHandle instanceHandle) { Fx.Assert(instanceHandle != null, "Null instanceHandle provided to InstanceHandleReference."); InstanceHandle = instanceHandle; } // This is set to null when the InstanceHandleReference is detached from the InstanceHandle - i.e. it is // no longer in use, and exists just to make it possible to lazily drain out of the various queues. internal InstanceHandle InstanceHandle { get; private set; } internal void Cancel() { Fx.Assert(InstanceHandle != null, "InstanceHandleReference already cancelled."); InstanceHandle = null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SettingsProperty.cs
- MethodToken.cs
- Wildcard.cs
- Task.cs
- SHA384.cs
- PerformanceCounterPermissionEntry.cs
- MemberMaps.cs
- MessageQueue.cs
- TextTreeTextBlock.cs
- GuidTagList.cs
- StringResourceManager.cs
- RtfFormatStack.cs
- MenuItemCollection.cs
- CFStream.cs
- AmbientEnvironment.cs
- OletxCommittableTransaction.cs
- CodeStatementCollection.cs
- RtType.cs
- shaperfactoryquerycacheentry.cs
- ToolboxComponentsCreatedEventArgs.cs
- CLSCompliantAttribute.cs
- _CacheStreams.cs
- ToolStripManager.cs
- Int64Animation.cs
- StyleTypedPropertyAttribute.cs
- ResolveCriteriaApril2005.cs
- Maps.cs
- PackageRelationshipSelector.cs
- ProvideValueServiceProvider.cs
- AddInSegmentDirectoryNotFoundException.cs
- GroupStyle.cs
- RectangleGeometry.cs
- ResourceExpressionEditorSheet.cs
- UnsafeNativeMethods.cs
- ProtocolsConfigurationEntry.cs
- BuildResult.cs
- ToolStripPanel.cs
- ChtmlCalendarAdapter.cs
- Attributes.cs
- DaylightTime.cs
- DataSourceDesigner.cs
- DataListItemCollection.cs
- LayoutTableCell.cs
- FocusChangedEventArgs.cs
- XPathDocumentNavigator.cs
- SecurityTokenProvider.cs
- DBBindings.cs
- TypeDependencyAttribute.cs
- EditingCommands.cs
- OledbConnectionStringbuilder.cs
- ThicknessKeyFrameCollection.cs
- DataSourceBooleanViewSchemaConverter.cs
- ResolveMatches11.cs
- ReadWriteObjectLock.cs
- Console.cs
- NegatedCellConstant.cs
- DecimalAverageAggregationOperator.cs
- WindowsToolbarItemAsMenuItem.cs
- Encoder.cs
- ProxyAttribute.cs
- TextSpanModifier.cs
- IPAddressCollection.cs
- Page.cs
- _AutoWebProxyScriptHelper.cs
- ResourceProviderFactory.cs
- EventRecord.cs
- ContractMapping.cs
- OdbcParameterCollection.cs
- MultiSelectRootGridEntry.cs
- TransformGroup.cs
- SerializationObjectManager.cs
- _ProxyChain.cs
- DocumentSequence.cs
- TaskCanceledException.cs
- Int16AnimationUsingKeyFrames.cs
- TerminatorSinks.cs
- BamlMapTable.cs
- ProviderManager.cs
- SystemResourceKey.cs
- CellQuery.cs
- XmlNamedNodeMap.cs
- HttpResponseHeader.cs
- ListViewItem.cs
- DocumentDesigner.cs
- GenericTypeParameterBuilder.cs
- Debug.cs
- AsyncPostBackErrorEventArgs.cs
- TreeNodeCollection.cs
- AutomationPropertyInfo.cs
- KeyMatchBuilder.cs
- Win32.cs
- CollectionDataContractAttribute.cs
- InvalidWMPVersionException.cs
- CompatibleComparer.cs
- PropertyPathConverter.cs
- BufferedGraphicsContext.cs
- UInt16Converter.cs
- MULTI_QI.cs
- BreakRecordTable.cs
- CompilerWrapper.cs