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
- AccessText.cs
- RandomDelaySendsAsyncResult.cs
- XpsPackagingPolicy.cs
- HttpCachePolicy.cs
- MultiByteCodec.cs
- ConfigXmlText.cs
- MarshalByRefObject.cs
- MessagePartDescription.cs
- Propagator.cs
- COM2AboutBoxPropertyDescriptor.cs
- Fonts.cs
- PropertyGridView.cs
- Dispatcher.cs
- ColumnHeader.cs
- CorrelationExtension.cs
- DataGridViewDesigner.cs
- SimpleWorkerRequest.cs
- StringComparer.cs
- GridProviderWrapper.cs
- HighlightVisual.cs
- FileDialogPermission.cs
- SelectionRange.cs
- TextDecorationCollectionConverter.cs
- ConfigurationValue.cs
- Enum.cs
- ImmutableObjectAttribute.cs
- ThemeDictionaryExtension.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- BindingSource.cs
- DirectoryObjectSecurity.cs
- DateBoldEvent.cs
- Preprocessor.cs
- Pair.cs
- ReadOnlyMetadataCollection.cs
- DrawingCollection.cs
- BevelBitmapEffect.cs
- ContextStack.cs
- TypeGeneratedEventArgs.cs
- RenderDataDrawingContext.cs
- CqlIdentifiers.cs
- ArgumentValueSerializer.cs
- TypedReference.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- RootContext.cs
- SubpageParagraph.cs
- XmlException.cs
- Listener.cs
- DWriteFactory.cs
- _DomainName.cs
- ServiceMetadataExtension.cs
- HashAlgorithm.cs
- ArcSegment.cs
- TraceFilter.cs
- __ComObject.cs
- FormatterConverter.cs
- TaiwanCalendar.cs
- IisNotInstalledException.cs
- ConnectionManagementSection.cs
- CacheDependency.cs
- PersistenceProviderDirectory.cs
- CqlBlock.cs
- XappLauncher.cs
- ChannelBinding.cs
- ExpressionConverter.cs
- SharedStatics.cs
- AlphabetConverter.cs
- TableStyle.cs
- KeyValuePairs.cs
- DesigntimeLicenseContext.cs
- CodeDOMUtility.cs
- EventPropertyMap.cs
- PointCollectionConverter.cs
- LineSegment.cs
- GridLength.cs
- DateTimeConverter2.cs
- TouchesOverProperty.cs
- WebExceptionStatus.cs
- CodeTypeReferenceCollection.cs
- WebPartHelpVerb.cs
- ComponentCollection.cs
- SamlAction.cs
- ServiceManagerHandle.cs
- DATA_BLOB.cs
- TypeSystem.cs
- FixedHighlight.cs
- FixedTextView.cs
- PeerResolverMode.cs
- ResponseStream.cs
- SharedStatics.cs
- CriticalHandle.cs
- Group.cs
- ISessionStateStore.cs
- CodeRegionDirective.cs
- SystemColorTracker.cs
- SafeSecurityHandles.cs
- CompilerGeneratedAttribute.cs
- XamlStream.cs
- ListDictionaryInternal.cs
- ScaleTransform.cs
- PagerStyle.cs