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
- _HeaderInfo.cs
- TranslateTransform3D.cs
- CollectionBase.cs
- EmptyEnumerator.cs
- XsdDuration.cs
- InlineUIContainer.cs
- Column.cs
- ZoneMembershipCondition.cs
- figurelength.cs
- Polygon.cs
- EntityAdapter.cs
- TimeSpanOrInfiniteConverter.cs
- MouseCaptureWithinProperty.cs
- Math.cs
- DataGridCellInfo.cs
- ListBox.cs
- ListItemViewAttribute.cs
- FacetChecker.cs
- EditingMode.cs
- CustomAttribute.cs
- SHA1Managed.cs
- MailAddressCollection.cs
- WmiPutTraceRecord.cs
- TransformerInfo.cs
- NestedContainer.cs
- GiveFeedbackEvent.cs
- BitmapSizeOptions.cs
- HtmlUtf8RawTextWriter.cs
- HostVisual.cs
- SoapAttributes.cs
- regiisutil.cs
- AdCreatedEventArgs.cs
- RadioButtonDesigner.cs
- PiiTraceSource.cs
- webeventbuffer.cs
- SqlInternalConnectionSmi.cs
- _IPv4Address.cs
- KeyGestureConverter.cs
- UserNameSecurityToken.cs
- StateRuntime.cs
- SoapReflectionImporter.cs
- ConnectionStringsExpressionBuilder.cs
- CompensableActivity.cs
- ExpressionBuilderContext.cs
- ViewCellRelation.cs
- MetadataPropertyvalue.cs
- WebMessageBodyStyleHelper.cs
- recordstate.cs
- PropertyIDSet.cs
- PathGradientBrush.cs
- safex509handles.cs
- DataGridViewSelectedRowCollection.cs
- ListGeneralPage.cs
- DirectionalLight.cs
- ZeroOpNode.cs
- UriTemplateVariablePathSegment.cs
- XmlHierarchicalDataSourceView.cs
- ResizingMessageFilter.cs
- Int64AnimationUsingKeyFrames.cs
- Transform3DGroup.cs
- hwndwrapper.cs
- ProfilePropertyMetadata.cs
- Listbox.cs
- SmtpDigestAuthenticationModule.cs
- Point4D.cs
- CLSCompliantAttribute.cs
- ReadOnlyActivityGlyph.cs
- HtmlForm.cs
- TimersDescriptionAttribute.cs
- DataServiceQueryException.cs
- HostSecurityManager.cs
- RtfToXamlReader.cs
- Screen.cs
- CaseCqlBlock.cs
- EncryptedKey.cs
- ControlPropertyNameConverter.cs
- DoubleAnimation.cs
- InternalConfigEventArgs.cs
- MailDefinition.cs
- Header.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- MDIControlStrip.cs
- TdsParserHelperClasses.cs
- WorkflowApplication.cs
- SafeRegistryHandle.cs
- SafeViewOfFileHandle.cs
- ZipIOFileItemStream.cs
- FragmentQueryProcessor.cs
- FormsAuthenticationEventArgs.cs
- ProvidersHelper.cs
- GridItemPattern.cs
- XamlToRtfWriter.cs
- WebPartZoneCollection.cs
- AutomationPatternInfo.cs
- ViewGenerator.cs
- DrawingGroup.cs
- TypeConverter.cs
- Util.cs
- SqlCharStream.cs
- MenuEventArgs.cs