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
- SafeProcessHandle.cs
- PlanCompiler.cs
- BaseUriHelper.cs
- KeyPressEvent.cs
- CapabilitiesAssignment.cs
- SoapElementAttribute.cs
- ProfileInfo.cs
- ButtonBaseAdapter.cs
- VirtualPath.cs
- ExpressionNode.cs
- TextBoxBase.cs
- documentsequencetextview.cs
- NullRuntimeConfig.cs
- ScopelessEnumAttribute.cs
- PathFigureCollectionConverter.cs
- DrawingDrawingContext.cs
- SqlLiftIndependentRowExpressions.cs
- HtmlElementErrorEventArgs.cs
- DesignBindingPicker.cs
- ReceiveMessageContent.cs
- RootBrowserWindow.cs
- ControlParameter.cs
- GridLength.cs
- HealthMonitoringSection.cs
- MSAAWinEventWrap.cs
- ConfigurationFileMap.cs
- ConstrainedGroup.cs
- Model3DGroup.cs
- WpfPayload.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- ZoneLinkButton.cs
- CompiledQueryCacheKey.cs
- RIPEMD160Managed.cs
- Line.cs
- EntityClientCacheKey.cs
- HttpProfileGroupBase.cs
- ControlUtil.cs
- MembershipValidatePasswordEventArgs.cs
- SafeProcessHandle.cs
- InstanceData.cs
- WindowsStartMenu.cs
- XmlDictionaryReaderQuotasElement.cs
- DesignTimeValidationFeature.cs
- ServiceManager.cs
- SettingsProperty.cs
- SqlTriggerAttribute.cs
- PreProcessInputEventArgs.cs
- SimpleTextLine.cs
- DefaultAutoFieldGenerator.cs
- XsltFunctions.cs
- CacheMode.cs
- DecimalConverter.cs
- GuidelineSet.cs
- ManipulationStartedEventArgs.cs
- DataGridViewCellStyleConverter.cs
- SQLConvert.cs
- HttpBrowserCapabilitiesBase.cs
- XamlFigureLengthSerializer.cs
- DropSourceBehavior.cs
- HttpConfigurationSystem.cs
- WindowsStatic.cs
- DbConnectionPoolCounters.cs
- ListItemsCollectionEditor.cs
- DocumentPageTextView.cs
- OleDbFactory.cs
- DataExpression.cs
- DragDrop.cs
- DesignerTransactionCloseEvent.cs
- Translator.cs
- ResolveResponseInfo.cs
- PeerNameRecord.cs
- EventRoute.cs
- XmlSchemaComplexType.cs
- BuildResultCache.cs
- UIElementHelper.cs
- TrackingMemoryStreamFactory.cs
- SqlDataAdapter.cs
- EdmValidator.cs
- SupportsEventValidationAttribute.cs
- SingleSelectRootGridEntry.cs
- ConnectionManager.cs
- ListViewInsertEventArgs.cs
- SecurityKeyUsage.cs
- StaticSiteMapProvider.cs
- FileDialogCustomPlacesCollection.cs
- TraceContextRecord.cs
- Maps.cs
- XsdDataContractExporter.cs
- SequenceDesigner.cs
- InputMethodStateTypeInfo.cs
- InfoCardMetadataExchangeClient.cs
- StringFreezingAttribute.cs
- JumpPath.cs
- RouteTable.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- SingleAnimationUsingKeyFrames.cs
- XmlSchemaObject.cs
- BamlRecords.cs
- MemberJoinTreeNode.cs
- PathSegment.cs