Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _Semaphore.cs / 1305376 / _Semaphore.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- #pragma warning disable 618 namespace System.Net { using System; using System.Threading; using System.Security.Permissions; // used for Connection Pooling internal sealed class Semaphore : WaitHandle { internal Semaphore(int initialCount, int maxCount) : base() { lock (this) { // Handle = UnsafeNclNativeMethods.CreateSemaphore(IntPtr.Zero, initialCount, maxCount, IntPtr.Zero); } } /* // Consider removing. public Semaphore(int initialCount, int maxCount, string name) : base() { lock (this) { // */ internal bool ReleaseSemaphore() { #if DEBUG int previousCount; bool success = UnsafeNclNativeMethods.ReleaseSemaphore(Handle, 1, out previousCount); GlobalLog.Print("ReleaseSemaphore#"+ValidationHelper.HashString(this)+" success:"+success+" previousCount:"+previousCount.ToString()); return success; #else return UnsafeNclNativeMethods.ReleaseSemaphore(Handle, 1, IntPtr.Zero); #endif } /* // Consider removing. internal bool ReleaseSemaphore(int releaseCount, out int previousCount) { return UnsafeNclNativeMethods.ReleaseSemaphore(Handle, releaseCount, out previousCount); } */ } } // 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
- AnimationClock.cs
- Effect.cs
- DbConnectionPoolGroup.cs
- FlowLayout.cs
- WebPartHeaderCloseVerb.cs
- SchemaDeclBase.cs
- DataControlFieldCollection.cs
- StaticFileHandler.cs
- SslStreamSecurityBindingElement.cs
- ProgressBarRenderer.cs
- DescendantBaseQuery.cs
- SqlNodeAnnotation.cs
- SafeNativeMethods.cs
- ColorTransformHelper.cs
- PriorityBinding.cs
- ExceptionHandlers.cs
- WindowsFormsSectionHandler.cs
- StrokeFIndices.cs
- UriSectionData.cs
- RefreshPropertiesAttribute.cs
- SmiEventSink.cs
- RelatedPropertyManager.cs
- ArraySet.cs
- ReplyChannelBinder.cs
- MemberMaps.cs
- StrongNameSignatureInformation.cs
- MetaType.cs
- ProxyManager.cs
- BehaviorEditorPart.cs
- RoutedPropertyChangedEventArgs.cs
- DBSqlParserColumn.cs
- CodeMethodReturnStatement.cs
- Signature.cs
- SoapSchemaMember.cs
- NameValueConfigurationElement.cs
- TargetConverter.cs
- PersonalizationEntry.cs
- PanelStyle.cs
- StretchValidation.cs
- MemberAccessException.cs
- ColumnBinding.cs
- MsmqTransportReceiveParameters.cs
- StrokeDescriptor.cs
- SQLInt16.cs
- XamlTypeMapper.cs
- ScriptModule.cs
- Attributes.cs
- ContentFilePart.cs
- IdentifierCreationService.cs
- MimeBasePart.cs
- cookiecollection.cs
- CommandPlan.cs
- AuthenticationModulesSection.cs
- PageThemeParser.cs
- HttpCacheVaryByContentEncodings.cs
- StatusBarItemAutomationPeer.cs
- UnsettableComboBox.cs
- SecurityPermission.cs
- AdRotator.cs
- ISFClipboardData.cs
- RectKeyFrameCollection.cs
- XPathDocumentNavigator.cs
- EventPrivateKey.cs
- CFStream.cs
- ReflectionServiceProvider.cs
- Ports.cs
- WorkflowItemPresenter.cs
- EmbeddedMailObject.cs
- MaxValueConverter.cs
- EditorPartChrome.cs
- ObjectReferenceStack.cs
- Message.cs
- VersionedStream.cs
- ProviderConnectionPoint.cs
- CrossSiteScriptingValidation.cs
- DES.cs
- CompiledQuery.cs
- QuaternionIndependentAnimationStorage.cs
- BufferModesCollection.cs
- SqlServices.cs
- SimpleHandlerBuildProvider.cs
- StateFinalizationDesigner.cs
- ConnectionStringsExpressionBuilder.cs
- ProtocolState.cs
- CapabilitiesState.cs
- Thickness.cs
- SafeReversePInvokeHandle.cs
- ScriptServiceAttribute.cs
- ClientScriptManager.cs
- SvcMapFileLoader.cs
- StructureChangedEventArgs.cs
- PositiveTimeSpanValidatorAttribute.cs
- SingleBodyParameterMessageFormatter.cs
- CompiledQuery.cs
- DataServiceRequestOfT.cs
- PropertyChangeTracker.cs
- NavigationWindowAutomationPeer.cs
- MLangCodePageEncoding.cs
- DefaultValueAttribute.cs
- Freezable.cs