Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Log / System / IO / Log / FileRecordSequenceCompletedAsyncResult.cs / 1305376 / FileRecordSequenceCompletedAsyncResult.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Diagnostics; using System.Runtime; using System.Threading; enum Work { Append, Flush, ReserveAndAppend, WriteRestartArea } sealed class FileRecordSequenceCompletedAsyncResult : IAsyncResult { SequenceNumber result; object userState; AsyncCallback callback; bool endCalled; Work work; object syncRoot; ManualResetEvent waitHandle; public FileRecordSequenceCompletedAsyncResult( SequenceNumber result, AsyncCallback callback, object userState, Work work) { this.result = result; this.callback = callback; this.userState = userState; this.work = work; this.syncRoot = new object(); if (this.callback != null) { try { this.callback(this); } #pragma warning suppress 56500 // This is a callback exception catch(Exception e) { if (Fx.IsFatal(e)) throw; throw DiagnosticUtility.ExceptionUtility.ThrowHelperCallback(e); } } } public Object AsyncState { get { return this.userState; } } public WaitHandle AsyncWaitHandle { get { lock(this.syncRoot) { // We won't ever close it (it must be GC'd instead), but try // not to be too excessive in allocations. // if (this.waitHandle == null) this.waitHandle = new ManualResetEvent(true); } return this.waitHandle; } } public bool CompletedSynchronously { get { return true; } } public Work CompletedWork { get { return this.work; } } public bool IsCompleted { get { return true; } } internal SequenceNumber End() { if (this.endCalled) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(Error.DuplicateEnd()); } this.endCalled = true; return this.result; } } } // 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
- WebPartConnectionsConfigureVerb.cs
- PropertySegmentSerializationProvider.cs
- HttpWebResponse.cs
- RoutedEventConverter.cs
- ToolboxItemCollection.cs
- ProfileSettingsCollection.cs
- DoubleCollectionConverter.cs
- CommittableTransaction.cs
- MultiBindingExpression.cs
- WasHostedComPlusFactory.cs
- TextTreeObjectNode.cs
- CompilationRelaxations.cs
- CompositeControl.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DebuggerAttributes.cs
- PaperSource.cs
- HttpApplicationFactory.cs
- ScriptControlManager.cs
- StringReader.cs
- AspNetSynchronizationContext.cs
- TableRowGroupCollection.cs
- Parameter.cs
- ApplicationSecurityManager.cs
- StringAttributeCollection.cs
- DataGridToolTip.cs
- CodeValidator.cs
- ScrollChrome.cs
- JournalEntryStack.cs
- BookmarkScopeInfo.cs
- TypeHelpers.cs
- DataServicePagingProviderWrapper.cs
- VisualBasicHelper.cs
- NetworkInformationPermission.cs
- EdmToObjectNamespaceMap.cs
- Blend.cs
- BaseComponentEditor.cs
- ResourceReader.cs
- ProviderBase.cs
- PropertySegmentSerializationProvider.cs
- BitmapPalette.cs
- DynamicHyperLink.cs
- datacache.cs
- UIServiceHelper.cs
- TextEffectResolver.cs
- InternalPolicyElement.cs
- Parser.cs
- remotingproxy.cs
- BmpBitmapEncoder.cs
- MessageDecoder.cs
- ProfileManager.cs
- ColumnMapCopier.cs
- HTMLTextWriter.cs
- ButtonBaseAutomationPeer.cs
- DataGridColumnHeaderCollection.cs
- Automation.cs
- CredentialManagerDialog.cs
- PathFigureCollectionConverter.cs
- QueryOptionExpression.cs
- WindowsImpersonationContext.cs
- GatewayDefinition.cs
- IconConverter.cs
- XsdValidatingReader.cs
- EntityType.cs
- MetadataArtifactLoader.cs
- ScrollData.cs
- MobileCapabilities.cs
- XmlReaderSettings.cs
- AdRotatorDesigner.cs
- AssemblyBuilderData.cs
- Console.cs
- MDIWindowDialog.cs
- BitmapSizeOptions.cs
- RotateTransform.cs
- FilteredReadOnlyMetadataCollection.cs
- ButtonAutomationPeer.cs
- Maps.cs
- ContextMarshalException.cs
- ClientSection.cs
- XmlNamedNodeMap.cs
- RowParagraph.cs
- TextEditorDragDrop.cs
- HierarchicalDataBoundControl.cs
- IList.cs
- DynamicResourceExtension.cs
- SqlFlattener.cs
- IntSecurity.cs
- SettingsAttributes.cs
- SynchronizedInputProviderWrapper.cs
- DefaultIfEmptyQueryOperator.cs
- LifetimeServices.cs
- PointConverter.cs
- XmlParser.cs
- SvcMapFileLoader.cs
- OLEDB_Enum.cs
- SqlCommand.cs
- HtmlTableRow.cs
- RawStylusActions.cs
- InsufficientMemoryException.cs
- NativeObjectSecurity.cs
- UnmanagedMemoryStreamWrapper.cs