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
- AnnotationHighlightLayer.cs
- PageAsyncTaskManager.cs
- SerializationTrace.cs
- CorrelationRequestContext.cs
- X509SecurityTokenProvider.cs
- Literal.cs
- StdRegProviderWrapper.cs
- MasterPageParser.cs
- SafeFileHandle.cs
- PersonalizationAdministration.cs
- DataTableMappingCollection.cs
- DataSourceControl.cs
- BaseValidator.cs
- Utils.cs
- ColumnPropertiesGroup.cs
- BaseParser.cs
- TextFormatterContext.cs
- MetadataException.cs
- coordinator.cs
- HeaderUtility.cs
- TouchFrameEventArgs.cs
- TargetParameterCountException.cs
- OleDbException.cs
- NamespaceEmitter.cs
- _AutoWebProxyScriptWrapper.cs
- MulticastOption.cs
- XPathCompileException.cs
- NotFiniteNumberException.cs
- AbsoluteQuery.cs
- DateTime.cs
- relpropertyhelper.cs
- ToolbarAUtomationPeer.cs
- DesignerProperties.cs
- LayoutUtils.cs
- AutomationPeer.cs
- ChangeBlockUndoRecord.cs
- Trace.cs
- StorageEntitySetMapping.cs
- TextDecorationCollection.cs
- DocumentSequenceHighlightLayer.cs
- XmlTextEncoder.cs
- XmlUrlResolver.cs
- SqlDataSourceStatusEventArgs.cs
- DataGridViewIntLinkedList.cs
- LoginDesigner.cs
- ConnectionsZone.cs
- Mappings.cs
- ILGenerator.cs
- CompModSwitches.cs
- TextServicesDisplayAttributePropertyRanges.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- FilterElement.cs
- PermissionSetEnumerator.cs
- WebPartHelpVerb.cs
- SizeLimitedCache.cs
- GradientStopCollection.cs
- PipeStream.cs
- Utils.cs
- RelOps.cs
- HtmlInputSubmit.cs
- SizeValueSerializer.cs
- LabelLiteral.cs
- ChannelAcceptor.cs
- Attribute.cs
- DebuggerAttributes.cs
- XmlDataDocument.cs
- Pair.cs
- XXXOnTypeBuilderInstantiation.cs
- ContentControl.cs
- KeyEvent.cs
- XmlValueConverter.cs
- StringWriter.cs
- TextBoxView.cs
- EventLogSession.cs
- JapaneseCalendar.cs
- Geometry3D.cs
- DataGridViewDataErrorEventArgs.cs
- DeviceFilterDictionary.cs
- ConfigurationStrings.cs
- ConstraintEnumerator.cs
- AuthorizationSection.cs
- XpsS0ValidatingLoader.cs
- COM2EnumConverter.cs
- XmlDocumentFieldSchema.cs
- ObjectMemberMapping.cs
- StructuredCompositeActivityDesigner.cs
- GridViewUpdatedEventArgs.cs
- SelectionRangeConverter.cs
- VersionPair.cs
- TemplateBuilder.cs
- HtmlShimManager.cs
- NoClickablePointException.cs
- BitmapVisualManager.cs
- SoapIncludeAttribute.cs
- XmlMessageFormatter.cs
- UnsafeNetInfoNativeMethods.cs
- ColorDialog.cs
- EventMappingSettings.cs
- OperationCanceledException.cs
- TreeWalkHelper.cs