Code:
/ FX-1434 / FX-1434 / 1.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
- Button.cs
- ErrorWrapper.cs
- XmlSchemaImport.cs
- GeometryHitTestResult.cs
- WindowsPen.cs
- OdbcEnvironmentHandle.cs
- NGCPageContentSerializerAsync.cs
- PageParser.cs
- DomainConstraint.cs
- DetailsViewRowCollection.cs
- InkCanvas.cs
- XmlQuerySequence.cs
- CodeGroup.cs
- ListControlBuilder.cs
- LinkButton.cs
- BuilderPropertyEntry.cs
- ImageKeyConverter.cs
- TypedLocationWrapper.cs
- ToolBar.cs
- HandleCollector.cs
- HtmlMobileTextWriter.cs
- ObjectDataSourceDisposingEventArgs.cs
- DataSourceDesigner.cs
- RegexParser.cs
- Int32Storage.cs
- RelatedView.cs
- ExpressionTextBox.xaml.cs
- Drawing.cs
- NotFiniteNumberException.cs
- SmtpCommands.cs
- Script.cs
- streamingZipPartStream.cs
- GeometryModel3D.cs
- RegistryPermission.cs
- EditingCoordinator.cs
- ToolBarButton.cs
- EnumDataContract.cs
- fixedPageContentExtractor.cs
- XmlAutoDetectWriter.cs
- XmlNotation.cs
- TextPenaltyModule.cs
- IISUnsafeMethods.cs
- DateTimeOffsetConverter.cs
- Msmq.cs
- SpotLight.cs
- IDataContractSurrogate.cs
- QueryOperationResponseOfT.cs
- ReaderOutput.cs
- LayoutTableCell.cs
- RectValueSerializer.cs
- MenuItem.cs
- ToolZone.cs
- ITreeGenerator.cs
- ContainerSelectorActiveEvent.cs
- BCLDebug.cs
- ModelFunctionTypeElement.cs
- validationstate.cs
- DataPagerFieldCollection.cs
- ZipIOCentralDirectoryBlock.cs
- SecurityTokenSerializer.cs
- PageRanges.cs
- UpdatePanelControlTrigger.cs
- TrackPoint.cs
- PageCache.cs
- PreservationFileWriter.cs
- StylusTip.cs
- UserPreferenceChangingEventArgs.cs
- BatchServiceHost.cs
- XmlTextAttribute.cs
- ShaderEffect.cs
- Timer.cs
- MILUtilities.cs
- TimeIntervalCollection.cs
- StrokeCollectionConverter.cs
- WindowsGraphicsWrapper.cs
- DoubleLinkListEnumerator.cs
- DBCommandBuilder.cs
- CodeObject.cs
- KeysConverter.cs
- XmlSchemaIdentityConstraint.cs
- Stylesheet.cs
- PreloadedPackages.cs
- LocalServiceSecuritySettingsElement.cs
- ContainerControlDesigner.cs
- DynamicPropertyReader.cs
- RelatedImageListAttribute.cs
- Evidence.cs
- RelationshipConstraintValidator.cs
- EntityDataSourceDesigner.cs
- ApplicationSecurityManager.cs
- hresults.cs
- FileUtil.cs
- InvalidOperationException.cs
- PermissionToken.cs
- SimpleType.cs
- Exception.cs
- DataGridViewControlCollection.cs
- ConsumerConnectionPointCollection.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- XmlSignatureProperties.cs