Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / MultiAsyncResult.cs / 1305376 / MultiAsyncResult.cs
namespace System.Net.Mime { using System; internal class MultiAsyncResult : LazyAsyncResult { int outstanding; object context; internal MultiAsyncResult(object context, AsyncCallback callback, object state) : base(context,state,callback) { this.context = context; } internal object Context { get { return this.context; } } internal void Enter() { Increment(); } internal void Leave() { Decrement(); } internal void Leave(object result) { this.Result = result; Decrement(); } void Decrement() { if (System.Threading.Interlocked.Decrement(ref this.outstanding) == -1) { base.InvokeCallback(Result); } } void Increment() { System.Threading.Interlocked.Increment(ref this.outstanding); } internal void CompleteSequence() { Decrement(); } internal static object End(IAsyncResult result) { MultiAsyncResult thisPtr = (MultiAsyncResult)result; thisPtr.InternalWaitForCompletion(); return thisPtr.Result; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Net.Mime { using System; internal class MultiAsyncResult : LazyAsyncResult { int outstanding; object context; internal MultiAsyncResult(object context, AsyncCallback callback, object state) : base(context,state,callback) { this.context = context; } internal object Context { get { return this.context; } } internal void Enter() { Increment(); } internal void Leave() { Decrement(); } internal void Leave(object result) { this.Result = result; Decrement(); } void Decrement() { if (System.Threading.Interlocked.Decrement(ref this.outstanding) == -1) { base.InvokeCallback(Result); } } void Increment() { System.Threading.Interlocked.Increment(ref this.outstanding); } internal void CompleteSequence() { Decrement(); } internal static object End(IAsyncResult result) { MultiAsyncResult thisPtr = (MultiAsyncResult)result; thisPtr.InternalWaitForCompletion(); return thisPtr.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
- UInt16Storage.cs
- ToolStripItemRenderEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- PageVisual.cs
- SelectionService.cs
- DesignSurface.cs
- AssemblyCollection.cs
- TargetConverter.cs
- Function.cs
- TryExpression.cs
- CellTreeNodeVisitors.cs
- RsaKeyIdentifierClause.cs
- ConsumerConnectionPointCollection.cs
- FocusChangedEventArgs.cs
- NumberFormatInfo.cs
- ObjectMemberMapping.cs
- filewebresponse.cs
- tooltip.cs
- KoreanLunisolarCalendar.cs
- StateMachineHistory.cs
- RepeatBehavior.cs
- FlowDocumentView.cs
- XmlParserContext.cs
- XmlSchemaSimpleTypeUnion.cs
- ManipulationDeltaEventArgs.cs
- DataMemberConverter.cs
- QilPatternVisitor.cs
- DBConnectionString.cs
- FormatException.cs
- CodeTypeDelegate.cs
- IWorkflowDebuggerService.cs
- SelectedCellsChangedEventArgs.cs
- PropertyTabAttribute.cs
- LostFocusEventManager.cs
- AnimationTimeline.cs
- Matrix.cs
- OneToOneMappingSerializer.cs
- SerializationAttributes.cs
- DrawListViewColumnHeaderEventArgs.cs
- _NTAuthentication.cs
- GridViewUpdatedEventArgs.cs
- HierarchicalDataSourceControl.cs
- ServicePointManager.cs
- TextBlock.cs
- ValueOfAction.cs
- DataSourceXmlElementAttribute.cs
- JournalEntryStack.cs
- StatusBarDrawItemEvent.cs
- PeerName.cs
- TypePropertyEditor.cs
- documentsequencetextpointer.cs
- SessionSwitchEventArgs.cs
- FactoryGenerator.cs
- BitmapFrameEncode.cs
- WebPartUserCapability.cs
- SamlSubjectStatement.cs
- Visitor.cs
- SystemEvents.cs
- RubberbandSelector.cs
- DataGridViewCellCollection.cs
- CodeExpressionRuleDeclaration.cs
- UnsafeNativeMethods.cs
- UserUseLicenseDictionaryLoader.cs
- CodeThrowExceptionStatement.cs
- EncryptedHeader.cs
- SQLBytesStorage.cs
- Utils.cs
- Sentence.cs
- StringUtil.cs
- Model3D.cs
- ConnectionInterfaceCollection.cs
- ColumnResizeUndoUnit.cs
- AmbiguousMatchException.cs
- SafeRightsManagementHandle.cs
- SetterTriggerConditionValueConverter.cs
- AppModelKnownContentFactory.cs
- BinaryOperationBinder.cs
- AssociationTypeEmitter.cs
- SafeSerializationManager.cs
- GCHandleCookieTable.cs
- XmlSchemaAnnotation.cs
- _CookieModule.cs
- UIElement.cs
- SystemTcpConnection.cs
- KeyedHashAlgorithm.cs
- BezierSegment.cs
- Operand.cs
- ServiceBuildProvider.cs
- BamlResourceSerializer.cs
- ProfileInfo.cs
- TextEditorLists.cs
- X509Utils.cs
- TypeProvider.cs
- MergePropertyDescriptor.cs
- RepeatButtonAutomationPeer.cs
- WebPartDisplayMode.cs
- Rect.cs
- SendMailErrorEventArgs.cs
- PresentationTraceSources.cs
- SimpleTextLine.cs