Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Net / System / Net / Mail / MultiAsyncResult.cs / 1 / 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
- NonBatchDirectoryCompiler.cs
- ScrollPattern.cs
- ProcessHostMapPath.cs
- ExpressionBuilder.cs
- EntityDataSourceReferenceGroup.cs
- COM2ExtendedBrowsingHandler.cs
- XmlWhitespace.cs
- ServiceSecurityContext.cs
- DynamicActivityTypeDescriptor.cs
- OleDbEnumerator.cs
- ToolStripDropDownDesigner.cs
- XmlSchemaSimpleContentRestriction.cs
- ColorConvertedBitmap.cs
- CodeEventReferenceExpression.cs
- Ports.cs
- FrameworkEventSource.cs
- TypeLibConverter.cs
- ConnectorDragDropGlyph.cs
- GCHandleCookieTable.cs
- ProtectedConfigurationProviderCollection.cs
- MaxValueConverter.cs
- TreeIterator.cs
- ConfigXmlComment.cs
- documentsequencetextcontainer.cs
- DataObjectPastingEventArgs.cs
- ExpiredSecurityTokenException.cs
- AutoSizeComboBox.cs
- SmiRecordBuffer.cs
- XmlSchemaSimpleType.cs
- SQLInt64Storage.cs
- KeyGestureValueSerializer.cs
- AttributeEmitter.cs
- LoadWorkflowCommand.cs
- StylusPointProperties.cs
- TimeSpanStorage.cs
- DataColumnCollection.cs
- glyphs.cs
- BamlRecordReader.cs
- ReliableSessionElement.cs
- InputLanguage.cs
- LinqDataSourceEditData.cs
- FormattedTextSymbols.cs
- COMException.cs
- StructuralType.cs
- SystemFonts.cs
- DNS.cs
- MDIControlStrip.cs
- HtmlInputCheckBox.cs
- ImmutableCollection.cs
- RawStylusInputCustomData.cs
- XmlSequenceWriter.cs
- RIPEMD160.cs
- PartialCachingAttribute.cs
- PersistenceMetadataNamespace.cs
- AppliedDeviceFiltersEditor.cs
- Relationship.cs
- WindowsListViewGroupHelper.cs
- RoleGroup.cs
- UnsafeNativeMethodsMilCoreApi.cs
- LocationSectionRecord.cs
- CompressEmulationStream.cs
- PackageRelationshipCollection.cs
- WebServicesInteroperability.cs
- DrawListViewSubItemEventArgs.cs
- MetadataItemCollectionFactory.cs
- DataGridAutoFormat.cs
- Triangle.cs
- CollectionViewSource.cs
- ObjectConverter.cs
- SapiAttributeParser.cs
- MissingManifestResourceException.cs
- ValidateNames.cs
- ServiceModelConfigurationSection.cs
- _ListenerResponseStream.cs
- TreeWalker.cs
- CompensationDesigner.cs
- DateTimeConverter2.cs
- DataGridViewRowConverter.cs
- Internal.cs
- GeometryHitTestResult.cs
- SystemNetHelpers.cs
- UndirectedGraph.cs
- XmlObjectSerializerContext.cs
- SymDocumentType.cs
- TrackingStringDictionary.cs
- KeyMatchBuilder.cs
- CultureInfoConverter.cs
- DeploymentSection.cs
- XmlElementCollection.cs
- TableLayoutSettings.cs
- QueryResultOp.cs
- PackageStore.cs
- EventItfInfo.cs
- EncoderFallback.cs
- FixUpCollection.cs
- WebPartVerbCollection.cs
- CookieParameter.cs
- ChooseAction.cs
- PointCollection.cs
- COM2ComponentEditor.cs