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
- ObjectListItemCollection.cs
- DbMetaDataColumnNames.cs
- IssuedTokenParametersEndpointAddressElement.cs
- codemethodreferenceexpression.cs
- TreeNode.cs
- UtilityExtension.cs
- BasicCellRelation.cs
- RequestDescription.cs
- StylusButtonCollection.cs
- Invariant.cs
- RoleGroup.cs
- WebPartDescription.cs
- WebCodeGenerator.cs
- entityreference_tresulttype.cs
- RoleManagerModule.cs
- WebPartCatalogCloseVerb.cs
- CompositeClientFormatter.cs
- ContentPropertyAttribute.cs
- CodeConditionStatement.cs
- HttpFileCollectionWrapper.cs
- EventLogPermissionAttribute.cs
- MeshGeometry3D.cs
- SessionEndingEventArgs.cs
- FamilyCollection.cs
- Axis.cs
- PriorityItem.cs
- HttpModuleCollection.cs
- FileNotFoundException.cs
- CompressEmulationStream.cs
- WebPartTransformerAttribute.cs
- OracleMonthSpan.cs
- GetRecipientRequest.cs
- Animatable.cs
- ProfileSettingsCollection.cs
- QilUnary.cs
- WindowsStatusBar.cs
- InvalidComObjectException.cs
- _HeaderInfoTable.cs
- AssemblyBuilder.cs
- WindowsFormsSectionHandler.cs
- TableLayoutSettings.cs
- MailMessage.cs
- TextContainerHelper.cs
- RegistryPermission.cs
- SqlPersonalizationProvider.cs
- HtmlGenericControl.cs
- Int16Converter.cs
- LineUtil.cs
- DataGridViewCheckBoxColumn.cs
- SelectedDatesCollection.cs
- RootBuilder.cs
- MDIWindowDialog.cs
- OdbcTransaction.cs
- CapabilitiesRule.cs
- XmlSchemaAll.cs
- WebSysDefaultValueAttribute.cs
- DataBindingList.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- AssemblyNameProxy.cs
- XmlSchemaNotation.cs
- SecurityAccessDeniedException.cs
- dataprotectionpermissionattribute.cs
- ApplicationTrust.cs
- CharAnimationUsingKeyFrames.cs
- CollectionViewGroupInternal.cs
- BaseTemplateParser.cs
- ChangeTracker.cs
- ToolStripActionList.cs
- KernelTypeValidation.cs
- WebBrowserNavigatingEventHandler.cs
- UTF7Encoding.cs
- basenumberconverter.cs
- DataSetMappper.cs
- DbCommandDefinition.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- ButtonField.cs
- MimeObjectFactory.cs
- InfiniteTimeSpanConverter.cs
- BufferedGraphics.cs
- DispatcherProcessingDisabled.cs
- ThreadStaticAttribute.cs
- User.cs
- EntryWrittenEventArgs.cs
- FastEncoder.cs
- OrthographicCamera.cs
- DBCommand.cs
- _CacheStreams.cs
- VariableReference.cs
- NamespaceMapping.cs
- Predicate.cs
- CalendarTable.cs
- Polygon.cs
- ViewBox.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ObjectContextServiceProvider.cs
- SynchronizedReadOnlyCollection.cs
- MessageDescriptionCollection.cs
- DPAPIProtectedConfigurationProvider.cs
- HashMembershipCondition.cs
- ConstrainedDataObject.cs