Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Pool.cs / 1305376 / Pool.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel { // see SynchronizedPoolfor a threadsafe implementation class Pool where T : class { T[] items; int count; public Pool(int maxCount) { items = new T[maxCount]; } public int Count { get { return count; } } public T Take() { if (count > 0) { T item = items[--count]; items[count] = null; return item; } else { return null; } } public bool Return(T item) { if (count < items.Length) { items[count++] = item; return true; } else { return false; } } public void Clear() { for (int i = 0; i < count; i++) items[i] = null; count = 0; } } } // 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
- ILGenerator.cs
- DataRecordInternal.cs
- CapabilitiesUse.cs
- ToolStripItemDataObject.cs
- SupportsEventValidationAttribute.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- ExpressionWriter.cs
- TransformerTypeCollection.cs
- UIntPtr.cs
- GroupStyle.cs
- OrthographicCamera.cs
- NameObjectCollectionBase.cs
- StrokeNodeData.cs
- TextRangeEditTables.cs
- CannotUnloadAppDomainException.cs
- SchemaMapping.cs
- Span.cs
- SecureConversationSecurityTokenParameters.cs
- AuthenticationException.cs
- ISAPIApplicationHost.cs
- RelatedPropertyManager.cs
- EditCommandColumn.cs
- DiscoveryReference.cs
- RadioButtonAutomationPeer.cs
- PassportIdentity.cs
- Vector3DAnimation.cs
- CombinedGeometry.cs
- NGCPageContentSerializerAsync.cs
- Transform.cs
- DelegatingTypeDescriptionProvider.cs
- CallContext.cs
- StorageMappingItemCollection.cs
- ModelItemExtensions.cs
- QilPatternFactory.cs
- TemplateBamlTreeBuilder.cs
- MoveSizeWinEventHandler.cs
- XmlRootAttribute.cs
- SpeakCompletedEventArgs.cs
- FlowDocumentFormatter.cs
- PasswordPropertyTextAttribute.cs
- DetailsView.cs
- ParserStreamGeometryContext.cs
- WindowsIdentity.cs
- InstanceDescriptor.cs
- WeakReadOnlyCollection.cs
- MenuItemStyleCollection.cs
- CommandField.cs
- TimeZone.cs
- NamedPipeAppDomainProtocolHandler.cs
- RequestResponse.cs
- DesignerCommandAdapter.cs
- DecimalAnimation.cs
- PipelineComponent.cs
- ComponentManagerBroker.cs
- FontDialog.cs
- PermissionRequestEvidence.cs
- AnimationStorage.cs
- WeakReadOnlyCollection.cs
- SchemaObjectWriter.cs
- DataGridColumn.cs
- ModelTreeManager.cs
- AppDomainUnloadedException.cs
- HostedController.cs
- DropShadowEffect.cs
- TimelineGroup.cs
- ToolStripContentPanel.cs
- InteropBitmapSource.cs
- SynchronizedDisposablePool.cs
- GridViewRowPresenterBase.cs
- TextTreeTextBlock.cs
- DialogBaseForm.cs
- XmlMapping.cs
- Model3D.cs
- InternalBufferManager.cs
- StringCollection.cs
- IERequestCache.cs
- ListViewGroupConverter.cs
- BaseDataListDesigner.cs
- CodeParameterDeclarationExpression.cs
- TextSelectionHelper.cs
- SecurityElement.cs
- CompositionTarget.cs
- User.cs
- Method.cs
- CryptoApi.cs
- ViewManager.cs
- EntityKeyElement.cs
- InkCanvasInnerCanvas.cs
- Italic.cs
- BlockUIContainer.cs
- RenderOptions.cs
- UndoManager.cs
- ElementUtil.cs
- IsolatedStorageSecurityState.cs
- XmlChoiceIdentifierAttribute.cs
- TextRunCache.cs
- CustomAttribute.cs
- SamlAuthenticationClaimResource.cs
- UnsafeNativeMethodsTablet.cs
- ControlBuilder.cs