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
- PropertyContainer.cs
- DependencyObject.cs
- KeyEvent.cs
- MatrixStack.cs
- SoapServerMessage.cs
- GifBitmapDecoder.cs
- HandlerFactoryWrapper.cs
- SiteMapPath.cs
- WhiteSpaceTrimStringConverter.cs
- ColorConvertedBitmap.cs
- ResourceCategoryAttribute.cs
- TextTreeUndoUnit.cs
- DateTimeConstantAttribute.cs
- StrongNameUtility.cs
- EmbeddedMailObjectsCollection.cs
- EqualityArray.cs
- ComponentEditorForm.cs
- SemanticBasicElement.cs
- XmlSchemaSimpleContentExtension.cs
- FrameworkElement.cs
- WeakHashtable.cs
- PolygonHotSpot.cs
- Dispatcher.cs
- SQLInt16Storage.cs
- PenThread.cs
- SqlExpander.cs
- AcceleratedTokenAuthenticator.cs
- CodeExporter.cs
- WinFormsUtils.cs
- VScrollProperties.cs
- backend.cs
- WizardDesigner.cs
- DataSet.cs
- ModifierKeysConverter.cs
- BaseTemplateBuildProvider.cs
- DebugInfo.cs
- CustomCategoryAttribute.cs
- MouseCaptureWithinProperty.cs
- BamlRecordReader.cs
- ForEachAction.cs
- WindowsListViewGroup.cs
- WmlLabelAdapter.cs
- System.Data_BID.cs
- PersonalizationEntry.cs
- XamlSerializerUtil.cs
- DetailsViewUpdatedEventArgs.cs
- CodeTypeReference.cs
- MergeFailedEvent.cs
- UnionCodeGroup.cs
- _NetRes.cs
- ReadingWritingEntityEventArgs.cs
- PerfCounters.cs
- Compiler.cs
- Panel.cs
- SelectorAutomationPeer.cs
- MruCache.cs
- GraphicsPath.cs
- LineVisual.cs
- StructuralObject.cs
- OutputChannel.cs
- sqlstateclientmanager.cs
- ListSourceHelper.cs
- MouseDevice.cs
- Aggregates.cs
- PathFigure.cs
- HttpWrapper.cs
- DocumentPageViewAutomationPeer.cs
- PointConverter.cs
- GenericsInstances.cs
- ConnectionPointCookie.cs
- ResXResourceSet.cs
- WindowsHyperlink.cs
- StatusBarPanelClickEvent.cs
- PersonalizationProviderHelper.cs
- AdCreatedEventArgs.cs
- CodePageUtils.cs
- WmlLabelAdapter.cs
- FileDialog_Vista_Interop.cs
- ServiceX509SecurityTokenProvider.cs
- BmpBitmapDecoder.cs
- GlobalAclOperationRequirement.cs
- XsltException.cs
- SoapProcessingBehavior.cs
- ElapsedEventArgs.cs
- CurrencyManager.cs
- RIPEMD160Managed.cs
- DataStreamFromComStream.cs
- SqlDataSourceView.cs
- TextTreeTextElementNode.cs
- Margins.cs
- XmlSchemaValidationException.cs
- GridViewHeaderRowPresenter.cs
- ListenerAdapterBase.cs
- HighlightComponent.cs
- FontClient.cs
- documentsequencetextpointer.cs
- ValidationHelper.cs
- IxmlLineInfo.cs
- DataGridViewCellFormattingEventArgs.cs
- BufferModeSettings.cs