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
- ItemCollection.cs
- RtType.cs
- Array.cs
- PriorityItem.cs
- PageParserFilter.cs
- TextBoxLine.cs
- SubtreeProcessor.cs
- SiteMapDataSourceView.cs
- VersionedStream.cs
- XsdBuildProvider.cs
- TreeViewBindingsEditor.cs
- NullRuntimeConfig.cs
- Registration.cs
- PerformanceCountersElement.cs
- DataSourceControl.cs
- StyleSelector.cs
- StringCollection.cs
- LinqDataSourceHelper.cs
- DataGridViewTextBoxColumn.cs
- BezierSegment.cs
- BufferBuilder.cs
- UnderstoodHeaders.cs
- Vector3D.cs
- Base64Encoder.cs
- RequestQueryParser.cs
- AttributeUsageAttribute.cs
- PinnedBufferMemoryStream.cs
- HttpClientCertificate.cs
- OleDbReferenceCollection.cs
- MemoryStream.cs
- TimeManager.cs
- ProcessingInstructionAction.cs
- DataColumnMapping.cs
- SqlFactory.cs
- OrderPreservingPipeliningSpoolingTask.cs
- PermissionAttributes.cs
- WindowsNonControl.cs
- AssemblyCacheEntry.cs
- TrackingMemoryStream.cs
- DynamicActivityXamlReader.cs
- StrokeNodeOperations2.cs
- JournalEntryListConverter.cs
- ConfigXmlDocument.cs
- ListViewHitTestInfo.cs
- CompiledQuery.cs
- ResizeGrip.cs
- Emitter.cs
- GridPatternIdentifiers.cs
- StringPropertyBuilder.cs
- BigInt.cs
- HostedBindingBehavior.cs
- CodeGenerationManager.cs
- PolicyException.cs
- ChangeTracker.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- Int16AnimationUsingKeyFrames.cs
- CodeRegionDirective.cs
- DeleteMemberBinder.cs
- RemotingSurrogateSelector.cs
- DiscardableAttribute.cs
- DataGridRelationshipRow.cs
- StrokeRenderer.cs
- FocusTracker.cs
- sqlnorm.cs
- Schema.cs
- MenuItem.cs
- dbdatarecord.cs
- GenerateScriptTypeAttribute.cs
- EdmType.cs
- UniqueIdentifierService.cs
- CaseCqlBlock.cs
- XmlSerializer.cs
- BitmapFrameDecode.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- HwndSubclass.cs
- OleDbSchemaGuid.cs
- ReadOnlyDictionary.cs
- DSASignatureFormatter.cs
- ClrProviderManifest.cs
- EntityDataSourceWrapper.cs
- DirectoryLocalQuery.cs
- ResourceDictionaryCollection.cs
- ExpressionBuilderCollection.cs
- MenuItemStyle.cs
- lengthconverter.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ProfileGroupSettings.cs
- CustomErrorsSectionWrapper.cs
- KeySplineConverter.cs
- TextOnlyOutput.cs
- SettingsPropertyWrongTypeException.cs
- SoapRpcServiceAttribute.cs
- UrlPropertyAttribute.cs
- Deserializer.cs
- MetafileEditor.cs
- ErrorWrapper.cs
- WebPartConnectionsCancelVerb.cs
- WorkflowFormatterBehavior.cs
- OpenTypeLayoutCache.cs
- EventDescriptor.cs