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
- CustomActivityDesigner.cs
- ProvidersHelper.cs
- RepeaterItemCollection.cs
- RadioButtonList.cs
- PathGeometry.cs
- XmlArrayAttribute.cs
- RSAOAEPKeyExchangeFormatter.cs
- RulePatternOps.cs
- PlaceHolder.cs
- UInt32Converter.cs
- RequestCache.cs
- KeyManager.cs
- MemberPathMap.cs
- GeometryConverter.cs
- ExtendedTransformFactory.cs
- StateRuntime.cs
- ToolStripStatusLabel.cs
- RangeContentEnumerator.cs
- _TimerThread.cs
- InputEventArgs.cs
- MetaColumn.cs
- TextEndOfParagraph.cs
- InheritanceService.cs
- DateTimeSerializationSection.cs
- RotateTransform3D.cs
- TextCollapsingProperties.cs
- DataRelationCollection.cs
- TextProperties.cs
- RadioButtonDesigner.cs
- DocumentPageView.cs
- RegisteredArrayDeclaration.cs
- ExpressionDumper.cs
- IPEndPointCollection.cs
- ServiceMemoryGates.cs
- WebBrowserEvent.cs
- OLEDB_Util.cs
- SymmetricAlgorithm.cs
- OracleColumn.cs
- PathFigure.cs
- EventRoute.cs
- Simplifier.cs
- SHA512Managed.cs
- ServiceProviders.cs
- DataColumnCollection.cs
- TcpStreams.cs
- ContextDataSourceView.cs
- PageParser.cs
- DeclaredTypeValidator.cs
- SystemColors.cs
- EffectiveValueEntry.cs
- XmlElementAttribute.cs
- KeyboardEventArgs.cs
- WebControlsSection.cs
- XmlJsonReader.cs
- ColorTranslator.cs
- ParameterModifier.cs
- Connector.cs
- ListViewItemSelectionChangedEvent.cs
- StructuralType.cs
- CustomError.cs
- SoapSchemaMember.cs
- CapabilitiesState.cs
- TextTreeFixupNode.cs
- ResourceCategoryAttribute.cs
- RoleGroup.cs
- FormatStringEditor.cs
- TopClause.cs
- HtmlTableRow.cs
- BuildProvidersCompiler.cs
- Int32Converter.cs
- Stylesheet.cs
- PeerService.cs
- Int32Animation.cs
- BindingCompleteEventArgs.cs
- TdsParserSafeHandles.cs
- SectionRecord.cs
- PnrpPeerResolver.cs
- NullableBoolConverter.cs
- SignerInfo.cs
- InstanceKeyView.cs
- DriveInfo.cs
- SectionVisual.cs
- TreeNodeEventArgs.cs
- SettingsBindableAttribute.cs
- RijndaelManaged.cs
- CorePropertiesFilter.cs
- Exceptions.cs
- GZipDecoder.cs
- DataServiceRequestOfT.cs
- DataContract.cs
- TypePresenter.xaml.cs
- NumericPagerField.cs
- FileUtil.cs
- ItemCheckedEvent.cs
- TreeViewImageIndexConverter.cs
- FixedDocument.cs
- PageRequestManager.cs
- MessageLogger.cs
- TdsParserHelperClasses.cs
- ObjectView.cs