Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Log / System / IO / Log / FileRecordSequenceCompletedAsyncResult.cs / 1 / FileRecordSequenceCompletedAsyncResult.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IO.Log { using System; using System.Diagnostics; 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 (DiagnosticUtility.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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ConfigXmlAttribute.cs
- HtmlFormWrapper.cs
- MemberProjectionIndex.cs
- OptimalTextSource.cs
- ConfigXmlWhitespace.cs
- PrimitiveCodeDomSerializer.cs
- DependencyPropertyKind.cs
- ArgumentDesigner.xaml.cs
- ToolStripItemTextRenderEventArgs.cs
- Type.cs
- TextTreeInsertUndoUnit.cs
- Activity.cs
- WithParamAction.cs
- DataError.cs
- ResXDataNode.cs
- ButtonColumn.cs
- HttpProfileGroupBase.cs
- ArrangedElement.cs
- SpellerStatusTable.cs
- FocusTracker.cs
- SchemaElement.cs
- DefaultIfEmptyQueryOperator.cs
- Marshal.cs
- LazyTextWriterCreator.cs
- BCryptSafeHandles.cs
- FontFamily.cs
- DLinqDataModelProvider.cs
- AsyncContentLoadedEventArgs.cs
- Table.cs
- ProfileBuildProvider.cs
- DataSourceView.cs
- D3DImage.cs
- ValidationError.cs
- RelationshipEndMember.cs
- CollectionChangeEventArgs.cs
- CodeEntryPointMethod.cs
- _ListenerAsyncResult.cs
- BinaryConverter.cs
- TemplateComponentConnector.cs
- InternalRelationshipCollection.cs
- Point3D.cs
- CompleteWizardStep.cs
- _NegoState.cs
- SQLMoney.cs
- ConstraintStruct.cs
- Maps.cs
- FontFamilyValueSerializer.cs
- Preprocessor.cs
- HttpsHostedTransportConfiguration.cs
- FlowPanelDesigner.cs
- SqlNotificationEventArgs.cs
- PropertyPathWorker.cs
- LoginCancelEventArgs.cs
- XmlAnyElementAttributes.cs
- ImageMapEventArgs.cs
- OutputCacheProfile.cs
- StringValidator.cs
- ProxyWebPart.cs
- UrlPath.cs
- SimpleExpression.cs
- XmlSchemaAppInfo.cs
- RecordManager.cs
- SocketInformation.cs
- DataColumnChangeEvent.cs
- CqlLexer.cs
- AssemblyBuilder.cs
- TemplatedWizardStep.cs
- XmlObjectSerializer.cs
- Attributes.cs
- DrawingBrush.cs
- BoolExpressionVisitors.cs
- RoleGroup.cs
- SemanticResultValue.cs
- GridViewRowPresenterBase.cs
- ImageSourceValueSerializer.cs
- MaterialGroup.cs
- ContextMenu.cs
- TraceUtility.cs
- ImageBrush.cs
- ToolboxItem.cs
- RowParagraph.cs
- ServiceOperation.cs
- MetadataItemEmitter.cs
- SemanticAnalyzer.cs
- NativeMethods.cs
- CurrentTimeZone.cs
- XmlSchemaComplexContentExtension.cs
- CodeDomConfigurationHandler.cs
- PositiveTimeSpanValidatorAttribute.cs
- AlternateView.cs
- DataGridRow.cs
- TimeManager.cs
- DbProviderFactories.cs
- ThreadStaticAttribute.cs
- LayoutDump.cs
- SqlBooleanMismatchVisitor.cs
- TreeNodeEventArgs.cs
- SqlInternalConnectionTds.cs
- If.cs
- DrawingState.cs