Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / _Semaphore.cs / 1305376 / _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); } */ } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GetIndexBinder.cs
- CodeStatementCollection.cs
- ToolStripTextBox.cs
- Cloud.cs
- BoolExpression.cs
- DrawingGroup.cs
- FontInfo.cs
- Attributes.cs
- RestHandlerFactory.cs
- GorillaCodec.cs
- nulltextnavigator.cs
- CodeActivityMetadata.cs
- ScriptMethodAttribute.cs
- Pkcs9Attribute.cs
- httpstaticobjectscollection.cs
- PrincipalPermission.cs
- Double.cs
- SoapCommonClasses.cs
- SkewTransform.cs
- PropertyItem.cs
- SamlAuthorizationDecisionClaimResource.cs
- SqlHelper.cs
- CustomWebEventKey.cs
- ObjectQueryExecutionPlan.cs
- AdornedElementPlaceholder.cs
- ChineseLunisolarCalendar.cs
- unsafenativemethodstextservices.cs
- MouseWheelEventArgs.cs
- IndentedWriter.cs
- keycontainerpermission.cs
- EntitySetDataBindingList.cs
- Gdiplus.cs
- X509DefaultServiceCertificateElement.cs
- ObjectStateManagerMetadata.cs
- ListViewDataItem.cs
- UnsafeNativeMethods.cs
- WebHttpBindingCollectionElement.cs
- PathSegmentCollection.cs
- Events.cs
- LinkedResource.cs
- Item.cs
- WebServiceData.cs
- WindowsListViewGroupSubsetLink.cs
- AnonymousIdentificationModule.cs
- UnsafeNativeMethods.cs
- AdPostCacheSubstitution.cs
- ContextMenu.cs
- TypeToken.cs
- MergePropertyDescriptor.cs
- WebPartChrome.cs
- xsdvalidator.cs
- GeneralTransform3DTo2D.cs
- TextDecorationUnitValidation.cs
- TextChange.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- SessionStateUtil.cs
- ButtonBaseAdapter.cs
- InputDevice.cs
- BaseParser.cs
- DbDataAdapter.cs
- TextEditorSpelling.cs
- Lasso.cs
- ElementHost.cs
- EventDescriptorCollection.cs
- FixedBufferAttribute.cs
- CharacterBufferReference.cs
- LineMetrics.cs
- XmlBinaryReaderSession.cs
- EventQueueState.cs
- DataFormats.cs
- Rijndael.cs
- AutomationEvent.cs
- TextRunProperties.cs
- GB18030Encoding.cs
- UniformGrid.cs
- ImageButton.cs
- baseaxisquery.cs
- SystemColorTracker.cs
- TextEditorParagraphs.cs
- ToolStripSystemRenderer.cs
- InternalConfigEventArgs.cs
- SimpleWebHandlerParser.cs
- ButtonAutomationPeer.cs
- WindowsGrip.cs
- DataViewSetting.cs
- HtmlLinkAdapter.cs
- RSACryptoServiceProvider.cs
- Vector3DAnimation.cs
- PrintPreviewControl.cs
- ServiceModelSecurityTokenRequirement.cs
- DoubleCollection.cs
- MembershipUser.cs
- IssuedTokenClientCredential.cs
- DbSetClause.cs
- KeyPressEvent.cs
- WebHttpBindingCollectionElement.cs
- counter.cs
- WebPartVerbsEventArgs.cs
- NativeActivityMetadata.cs
- BitmapCacheBrush.cs