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
- TreeViewImageGenerator.cs
- SerialPort.cs
- WindowsHyperlink.cs
- HttpFormatExtensions.cs
- ListViewAutomationPeer.cs
- WriterOutput.cs
- ViewDesigner.cs
- QueryExpr.cs
- QilTypeChecker.cs
- FakeModelItemImpl.cs
- FamilyMapCollection.cs
- TimeSpan.cs
- CategoryAttribute.cs
- Classification.cs
- WindowsPen.cs
- Resources.Designer.cs
- VsPropertyGrid.cs
- CommandHelpers.cs
- TextDecorationUnitValidation.cs
- SamlSerializer.cs
- OptimalTextSource.cs
- SafeFileMappingHandle.cs
- Win32.cs
- DesigntimeLicenseContext.cs
- brushes.cs
- bindurihelper.cs
- HostingEnvironmentException.cs
- PresentationAppDomainManager.cs
- PopupRoot.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- CustomError.cs
- StorageAssociationTypeMapping.cs
- SmiXetterAccessMap.cs
- HwndAppCommandInputProvider.cs
- FactoryGenerator.cs
- dataprotectionpermissionattribute.cs
- ConfigurationCollectionAttribute.cs
- FlowDocumentPageViewerAutomationPeer.cs
- EndEvent.cs
- CodeSnippetCompileUnit.cs
- ToolStripControlHost.cs
- XmlCompatibilityReader.cs
- SafeCryptoKeyHandle.cs
- XmlSiteMapProvider.cs
- TypeDelegator.cs
- CellTreeNodeVisitors.cs
- HwndKeyboardInputProvider.cs
- ColumnWidthChangingEvent.cs
- SHA384Managed.cs
- CommonObjectSecurity.cs
- AttachmentCollection.cs
- DocobjHost.cs
- IPHostEntry.cs
- BinaryExpression.cs
- ValidatorCompatibilityHelper.cs
- ContentElementCollection.cs
- RoleManagerEventArgs.cs
- PlatformNotSupportedException.cs
- UnhandledExceptionEventArgs.cs
- CorrelationValidator.cs
- GridView.cs
- PersonalizationProviderHelper.cs
- HelpEvent.cs
- VirtualPathProvider.cs
- ImageDrawing.cs
- ReferencedType.cs
- Visitor.cs
- RequestResizeEvent.cs
- DataGridViewTextBoxEditingControl.cs
- DataGridViewRowStateChangedEventArgs.cs
- ClientCultureInfo.cs
- WebPartConnectionsCancelVerb.cs
- FreezableOperations.cs
- LockCookie.cs
- NavigationExpr.cs
- HttpListenerPrefixCollection.cs
- ActivityTrace.cs
- PrintDialogDesigner.cs
- UnsignedPublishLicense.cs
- OperationFormatStyle.cs
- BinarySecretSecurityToken.cs
- ZipIOCentralDirectoryBlock.cs
- ScriptControlDescriptor.cs
- MediaElementAutomationPeer.cs
- SimpleBitVector32.cs
- PathTooLongException.cs
- LineInfo.cs
- ReferencedType.cs
- ipaddressinformationcollection.cs
- XmlAttribute.cs
- ArraySortHelper.cs
- HttpTransportElement.cs
- BoundsDrawingContextWalker.cs
- CompilerGlobalScopeAttribute.cs
- Rule.cs
- SystemDiagnosticsSection.cs
- Int64KeyFrameCollection.cs
- XsltContext.cs
- PreservationFileReader.cs
- XmlSchemaElement.cs