Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / _Semaphore.cs / 1 / _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); } */ } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AssemblyBuilder.cs
- NamespaceInfo.cs
- SamlAssertionKeyIdentifierClause.cs
- ObjectPropertyMapping.cs
- PathFigureCollection.cs
- ListenUriMode.cs
- UserCancellationException.cs
- PropertyGridCommands.cs
- DesignerVerbCollection.cs
- ReferencedAssembly.cs
- AmbientProperties.cs
- CodeValidator.cs
- XsdDateTime.cs
- SecurityHeader.cs
- TemplateBuilder.cs
- LeafCellTreeNode.cs
- ComboBox.cs
- XmlUnspecifiedAttribute.cs
- ThemeDirectoryCompiler.cs
- PathFigure.cs
- VoiceChangeEventArgs.cs
- XmlAtomicValue.cs
- MetadataUtil.cs
- SmtpNetworkElement.cs
- ConfigurationSectionGroup.cs
- ProxyWebPart.cs
- DrawToolTipEventArgs.cs
- WebRequestModuleElement.cs
- Transactions.cs
- HijriCalendar.cs
- MimeMapping.cs
- SplineKeyFrames.cs
- CustomError.cs
- KeyPullup.cs
- DataConnectionHelper.cs
- PagerStyle.cs
- LambdaCompiler.Lambda.cs
- DataServiceQueryContinuation.cs
- BinaryObjectReader.cs
- SQLMembershipProvider.cs
- BrowsableAttribute.cs
- RecognizeCompletedEventArgs.cs
- DataTrigger.cs
- HttpModuleAction.cs
- AttributeExtensions.cs
- ViewStateException.cs
- XmlSchemaSimpleContent.cs
- MemberInitExpression.cs
- WaitForChangedResult.cs
- SetIndexBinder.cs
- TabletDevice.cs
- CollectionBase.cs
- IncrementalHitTester.cs
- SmtpDigestAuthenticationModule.cs
- OAVariantLib.cs
- UnsafeNativeMethods.cs
- SequenceQuery.cs
- UnsafeNativeMethods.cs
- ICollection.cs
- Point3DCollectionConverter.cs
- Process.cs
- HyperLinkField.cs
- datacache.cs
- BaseAddressPrefixFilterElementCollection.cs
- TableLayoutSettingsTypeConverter.cs
- DelimitedListTraceListener.cs
- SortableBindingList.cs
- InstancePersistenceException.cs
- DbProviderConfigurationHandler.cs
- FileSystemInfo.cs
- BamlLocalizabilityResolver.cs
- ValueUtilsSmi.cs
- InfocardExtendedInformationCollection.cs
- FormParameter.cs
- UserControl.cs
- WebHttpSecurityElement.cs
- Vector3dCollection.cs
- xdrvalidator.cs
- DisplayInformation.cs
- HTMLTextWriter.cs
- odbcmetadatafactory.cs
- InternalTypeHelper.cs
- FtpWebRequest.cs
- PagerSettings.cs
- SqlClientFactory.cs
- HttpAsyncResult.cs
- DataPagerFieldCommandEventArgs.cs
- DataGridLengthConverter.cs
- AppSettingsReader.cs
- HostSecurityManager.cs
- Opcode.cs
- HTTPNotFoundHandler.cs
- CodeDesigner.cs
- BaseParaClient.cs
- LogEntryDeserializer.cs
- ButtonColumn.cs
- DescendantQuery.cs
- Timeline.cs
- NumericExpr.cs
- SemaphoreFullException.cs