Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcEnvironment.cs / 1305376 / OdbcEnvironment.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- using System; using System.Data; using System.Data.Common; using System.Threading; namespace System.Data.Odbc { sealed internal class OdbcEnvironment { static private object _globalEnvironmentHandle; static private object _globalEnvironmentHandleLock = new object(); private OdbcEnvironment () {} // default const. static internal OdbcEnvironmentHandle GetGlobalEnvironmentHandle() { OdbcEnvironmentHandle globalEnvironmentHandle = _globalEnvironmentHandle as OdbcEnvironmentHandle; if(null == globalEnvironmentHandle) { ADP.CheckVersionMDAC(true); lock(_globalEnvironmentHandleLock) { globalEnvironmentHandle = _globalEnvironmentHandle as OdbcEnvironmentHandle; if(null == globalEnvironmentHandle) { globalEnvironmentHandle = new OdbcEnvironmentHandle(); _globalEnvironmentHandle = globalEnvironmentHandle; } } } return globalEnvironmentHandle; } static internal void ReleaseObjectPool() { object globalEnvironmentHandle = Interlocked.Exchange(ref _globalEnvironmentHandle, null); if(null != globalEnvironmentHandle) { (globalEnvironmentHandle as OdbcEnvironmentHandle).Dispose(); // internally refcounted so will happen correctly } } } } // 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
- X500Name.cs
- InfiniteTimeSpanConverter.cs
- EntityKey.cs
- DataGridViewTextBoxColumn.cs
- DateTimeParse.cs
- MenuAdapter.cs
- BooleanFacetDescriptionElement.cs
- URI.cs
- CompositeCollection.cs
- SystemIPInterfaceStatistics.cs
- SettingsProperty.cs
- FileLevelControlBuilderAttribute.cs
- XmlSchemas.cs
- IgnoreDeviceFilterElementCollection.cs
- ChineseLunisolarCalendar.cs
- FontCollection.cs
- SHA384Managed.cs
- TableItemStyle.cs
- TableCellCollection.cs
- SafeEventHandle.cs
- DeviceContext2.cs
- ReceiveActivityValidator.cs
- BypassElementCollection.cs
- ItemChangedEventArgs.cs
- RotateTransform3D.cs
- BaseServiceProvider.cs
- PropertyMetadata.cs
- ChannelServices.cs
- FixedSOMLineRanges.cs
- FullTextLine.cs
- FontFaceLayoutInfo.cs
- PassportIdentity.cs
- ThumbButtonInfoCollection.cs
- PersonalizationProvider.cs
- SecurityContext.cs
- CreateUserErrorEventArgs.cs
- QueryInterceptorAttribute.cs
- PartialList.cs
- VisualStyleRenderer.cs
- FormatException.cs
- DependencySource.cs
- SelectorAutomationPeer.cs
- ValidatingReaderNodeData.cs
- Padding.cs
- BackStopAuthenticationModule.cs
- ControlCollection.cs
- AmbientLight.cs
- TraceSection.cs
- QilInvokeEarlyBound.cs
- SoapEnvelopeProcessingElement.cs
- RequestTimeoutManager.cs
- Shape.cs
- ObjectStateEntry.cs
- namescope.cs
- _FtpDataStream.cs
- RsaKeyIdentifierClause.cs
- ColumnCollection.cs
- AncillaryOps.cs
- HostProtectionException.cs
- TextBox.cs
- PermissionSet.cs
- SimplePropertyEntry.cs
- IOException.cs
- WsdlContractConversionContext.cs
- CompilerCollection.cs
- InitializerFacet.cs
- _ListenerResponseStream.cs
- Control.cs
- ViewCellRelation.cs
- OutputWindow.cs
- Module.cs
- XmlHierarchicalDataSourceView.cs
- MessageDirection.cs
- BoolLiteral.cs
- FrameworkElementFactoryMarkupObject.cs
- TabControlAutomationPeer.cs
- RectangleConverter.cs
- UriParserTemplates.cs
- MembershipValidatePasswordEventArgs.cs
- InlineObject.cs
- relpropertyhelper.cs
- SoapCodeExporter.cs
- ChannelTokenTypeConverter.cs
- Floater.cs
- SecurityState.cs
- SchemaMapping.cs
- RTLAwareMessageBox.cs
- WebServiceParameterData.cs
- QueryCursorEventArgs.cs
- VectorCollectionValueSerializer.cs
- SapiGrammar.cs
- Point3D.cs
- SystemTcpConnection.cs
- MsmqHostedTransportManager.cs
- AccessDataSourceView.cs
- AuthStoreRoleProvider.cs
- LinkLabel.cs
- BaseValidatorDesigner.cs
- ComponentEditorPage.cs
- ProxyWebPartConnectionCollection.cs