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
- ParameterElement.cs
- LocatorPartList.cs
- BindableTemplateBuilder.cs
- DataRowExtensions.cs
- TypefaceMap.cs
- StringUtil.cs
- SoapAttributeAttribute.cs
- SmtpLoginAuthenticationModule.cs
- ImageUrlEditor.cs
- CompilationPass2Task.cs
- SchemaMerger.cs
- Pkcs7Recipient.cs
- PersonalizationStateInfoCollection.cs
- DataServiceQueryProvider.cs
- UidManager.cs
- MenuScrollingVisibilityConverter.cs
- ClientBuildManagerCallback.cs
- PKCS1MaskGenerationMethod.cs
- FontSource.cs
- UpDownBase.cs
- UpdateCommandGenerator.cs
- MDIClient.cs
- ToolStripItemCollection.cs
- SimplePropertyEntry.cs
- UriTemplateMatchException.cs
- SqlMethods.cs
- XsltLoader.cs
- DaylightTime.cs
- DbConnectionOptions.cs
- DecoderNLS.cs
- GenericEnumConverter.cs
- Statements.cs
- ReceiveActivityValidator.cs
- FileInfo.cs
- AudienceUriMode.cs
- Comparer.cs
- TemplateInstanceAttribute.cs
- TextDecorationCollectionConverter.cs
- Positioning.cs
- NegationPusher.cs
- datacache.cs
- TypeDescriptionProvider.cs
- PerformanceCounterLib.cs
- NavigationExpr.cs
- HttpModulesSection.cs
- TdsParameterSetter.cs
- InternalPermissions.cs
- DataControlCommands.cs
- StsCommunicationException.cs
- DelegatingTypeDescriptionProvider.cs
- RoleExceptions.cs
- OdbcConnectionHandle.cs
- WSSecurityXXX2005.cs
- OleStrCAMarshaler.cs
- Color.cs
- QilPatternFactory.cs
- DocumentGridContextMenu.cs
- UnauthorizedWebPart.cs
- ObjectResult.cs
- _NestedSingleAsyncResult.cs
- SerializationObjectManager.cs
- FixedSOMLineCollection.cs
- LogLogRecord.cs
- ConfigXmlCDataSection.cs
- ContentAlignmentEditor.cs
- ErrorTableItemStyle.cs
- JsonQNameDataContract.cs
- XmlSortKey.cs
- Int16.cs
- CodeArrayIndexerExpression.cs
- HandlerFactoryCache.cs
- ExpressionPrefixAttribute.cs
- SystemParameters.cs
- DataControlFieldHeaderCell.cs
- ModuleElement.cs
- EventlogProvider.cs
- EnumBuilder.cs
- SpeechAudioFormatInfo.cs
- ParameterToken.cs
- LiteralText.cs
- MaskedTextBox.cs
- ElementAction.cs
- PeerChannelFactory.cs
- ExtentJoinTreeNode.cs
- DependencyObjectType.cs
- CollectionView.cs
- KnownTypeHelper.cs
- NameSpaceEvent.cs
- COSERVERINFO.cs
- DataGridViewBand.cs
- UdpTransportSettings.cs
- BuildProviderAppliesToAttribute.cs
- RepeatButtonAutomationPeer.cs
- ValueQuery.cs
- DiscardableAttribute.cs
- WebControl.cs
- CodePageEncoding.cs
- WaitHandleCannotBeOpenedException.cs
- RegistrySecurity.cs
- HtmlLink.cs