Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Pool.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColorTransformHelper.cs
- SecurityResources.cs
- DoubleCollectionConverter.cs
- ConfigurationProperty.cs
- ServerTooBusyException.cs
- ListViewInsertionMark.cs
- EmbeddedMailObject.cs
- CheckBoxAutomationPeer.cs
- DropSource.cs
- DomNameTable.cs
- GlyphElement.cs
- DateTimeFormatInfo.cs
- XPathEmptyIterator.cs
- TextRangeProviderWrapper.cs
- OleDbReferenceCollection.cs
- SmtpException.cs
- MethodImplAttribute.cs
- GridViewUpdatedEventArgs.cs
- EdmProperty.cs
- IISMapPath.cs
- CheckBoxFlatAdapter.cs
- FileDialog_Vista.cs
- BaseValidatorDesigner.cs
- SchemaCreator.cs
- OrElse.cs
- ControlAdapter.cs
- InputBindingCollection.cs
- NavigatorInput.cs
- GradientStop.cs
- OutOfMemoryException.cs
- NotifyParentPropertyAttribute.cs
- BaseResourcesBuildProvider.cs
- TransactionsSectionGroup.cs
- GetChildSubtree.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- StringArrayConverter.cs
- ReadOnlyObservableCollection.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- TemplateParser.cs
- WebBrowserEvent.cs
- AttributeQuery.cs
- InheritablePropertyChangeInfo.cs
- SafeFindHandle.cs
- EntityContainerEmitter.cs
- ListViewGroupConverter.cs
- Baml2006ReaderSettings.cs
- GenericNameHandler.cs
- MetadataItemEmitter.cs
- FigureParagraph.cs
- TranslateTransform.cs
- InvokeHandlers.cs
- ContextMenuAutomationPeer.cs
- Attributes.cs
- FontUnitConverter.cs
- TreeNodeCollection.cs
- DebuggerAttributes.cs
- NetworkAddressChange.cs
- CompositeDataBoundControl.cs
- TagPrefixAttribute.cs
- CompiledScopeCriteria.cs
- messageonlyhwndwrapper.cs
- SHA384Managed.cs
- LinqDataSourceEditData.cs
- SmiRecordBuffer.cs
- LaxModeSecurityHeaderElementInferenceEngine.cs
- InstanceKeyView.cs
- TaiwanCalendar.cs
- DependencyStoreSurrogate.cs
- DependencySource.cs
- BaseValidator.cs
- SspiSafeHandles.cs
- Matrix3D.cs
- NumericPagerField.cs
- ColorBlend.cs
- EntityDataSourceDesigner.cs
- MultiTrigger.cs
- TreeNode.cs
- WebPartVerbCollection.cs
- MsmqBindingFilter.cs
- HttpContext.cs
- FakeModelPropertyImpl.cs
- AddInStore.cs
- ObjectConverter.cs
- JsonObjectDataContract.cs
- SafeArchiveContext.cs
- HttpWrapper.cs
- Win32SafeHandles.cs
- TileModeValidation.cs
- SafeWaitHandle.cs
- CustomLineCap.cs
- QueryStringParameter.cs
- LabelAutomationPeer.cs
- BindingEntityInfo.cs
- StreamReader.cs
- RuleRefElement.cs
- CommandValueSerializer.cs
- RegistrationProxy.cs
- ProviderMetadataCachedInformation.cs
- ReflectTypeDescriptionProvider.cs
- SqlParameterCollection.cs