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
- RegisteredHiddenField.cs
- Timer.cs
- ISAPIWorkerRequest.cs
- Interlocked.cs
- Run.cs
- MarginsConverter.cs
- PassportIdentity.cs
- MembershipUser.cs
- AliasedSlot.cs
- Peer.cs
- CheckBoxRenderer.cs
- SafeMILHandle.cs
- EventProxy.cs
- EntityDataSourceChangedEventArgs.cs
- ShapingEngine.cs
- BooleanProjectedSlot.cs
- TextEditorContextMenu.cs
- ValueConversionAttribute.cs
- Int64KeyFrameCollection.cs
- ImageMapEventArgs.cs
- BitmapMetadata.cs
- Nullable.cs
- XAMLParseException.cs
- BooleanFunctions.cs
- Speller.cs
- FormattedTextSymbols.cs
- ErrorFormatterPage.cs
- AutomationElement.cs
- Quaternion.cs
- DataSpaceManager.cs
- SecureUICommand.cs
- PromptBuilder.cs
- PointKeyFrameCollection.cs
- BaseValidator.cs
- CircleHotSpot.cs
- CopyCodeAction.cs
- InputMethodStateTypeInfo.cs
- ObfuscateAssemblyAttribute.cs
- PropagatorResult.cs
- unsafeIndexingFilterStream.cs
- WebMessageEncodingElement.cs
- StorageInfo.cs
- Context.cs
- SoapIgnoreAttribute.cs
- ExplicitDiscriminatorMap.cs
- QuaternionRotation3D.cs
- counter.cs
- MarshalByValueComponent.cs
- WindowsEditBox.cs
- ColumnHeader.cs
- SqlDelegatedTransaction.cs
- MatrixValueSerializer.cs
- WebBrowsableAttribute.cs
- IsolationInterop.cs
- TextEditorSelection.cs
- MsdtcClusterUtils.cs
- RadioButton.cs
- _DisconnectOverlappedAsyncResult.cs
- StandardBindingElementCollection.cs
- HttpStreamMessageEncoderFactory.cs
- ScriptControlManager.cs
- SocketManager.cs
- UshortList2.cs
- WithParamAction.cs
- codemethodreferenceexpression.cs
- MemberDomainMap.cs
- CodeTypeParameter.cs
- ShaderRenderModeValidation.cs
- MarkupCompiler.cs
- ManagedFilter.cs
- ListItemCollection.cs
- XmlElementList.cs
- IndividualDeviceConfig.cs
- TypefaceCollection.cs
- EmbeddedMailObject.cs
- AuthenticationModuleElement.cs
- ReachDocumentPageSerializer.cs
- Debugger.cs
- XmlWellformedWriter.cs
- XamlInt32CollectionSerializer.cs
- KeyConverter.cs
- ModelMemberCollection.cs
- FixedFindEngine.cs
- Rotation3D.cs
- CompilerResults.cs
- XamlBrushSerializer.cs
- RemoteHelper.cs
- XmlChoiceIdentifierAttribute.cs
- Currency.cs
- DBSchemaTable.cs
- ProxyGenerationError.cs
- ProvideValueServiceProvider.cs
- AnnotationService.cs
- ButtonRenderer.cs
- SimpleFileLog.cs
- JulianCalendar.cs
- RegexFCD.cs
- ValidationErrorCollection.cs
- OdbcEnvironment.cs
- SqlDataSourceWizardForm.cs