Code:
/ DotNET / DotNET / 8.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
- TypeToArgumentTypeConverter.cs
- ButtonChrome.cs
- ValidationVisibilityAttribute.cs
- WebServiceMethodData.cs
- XPathBuilder.cs
- ColumnMapVisitor.cs
- WeakReferenceList.cs
- ParagraphVisual.cs
- ObjectCloneHelper.cs
- StorageInfo.cs
- ProfileService.cs
- QilInvokeLateBound.cs
- IUnknownConstantAttribute.cs
- SecurityTokenRequirement.cs
- SettingsSavedEventArgs.cs
- TargetControlTypeAttribute.cs
- OdbcError.cs
- SqlCommandSet.cs
- FixedSOMGroup.cs
- ProgramPublisher.cs
- ScrollChrome.cs
- WindowHelperService.cs
- XmlAttributeOverrides.cs
- DocumentCollection.cs
- Predicate.cs
- FilterableAttribute.cs
- StorageMappingItemLoader.cs
- SettingsBindableAttribute.cs
- FixedSOMElement.cs
- InstanceKeyCompleteException.cs
- Accessible.cs
- SecurityChannel.cs
- AdapterDictionary.cs
- SqlFunctionAttribute.cs
- CustomSignedXml.cs
- JsonQNameDataContract.cs
- XPathSingletonIterator.cs
- SQLDateTimeStorage.cs
- PostBackTrigger.cs
- FileDialogCustomPlacesCollection.cs
- XamlReaderHelper.cs
- DocComment.cs
- DataSvcMapFile.cs
- LinkLabel.cs
- CodeGeneratorOptions.cs
- LicenseContext.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- SizeKeyFrameCollection.cs
- SplitContainer.cs
- TheQuery.cs
- GraphicsContext.cs
- ParseNumbers.cs
- OuterGlowBitmapEffect.cs
- ILGen.cs
- _ConnectStream.cs
- ViewManager.cs
- PerformanceCounterCategory.cs
- ZipIOLocalFileBlock.cs
- TagPrefixCollection.cs
- LiteralSubsegment.cs
- XmlNodeChangedEventManager.cs
- Thumb.cs
- XmlUrlResolver.cs
- VectorAnimationUsingKeyFrames.cs
- EFColumnProvider.cs
- PassportAuthenticationEventArgs.cs
- FixedTextView.cs
- XmlSecureResolver.cs
- XDeferredAxisSource.cs
- objectquery_tresulttype.cs
- WebPartZoneCollection.cs
- RtfFormatStack.cs
- SignedPkcs7.cs
- JournalEntryStack.cs
- TextDecorationLocationValidation.cs
- CursorInteropHelper.cs
- Authorization.cs
- SqlClientWrapperSmiStream.cs
- ResourceCollectionInfo.cs
- XmlSerializerObjectSerializer.cs
- DispatcherExceptionFilterEventArgs.cs
- PagerSettings.cs
- SessionEndedEventArgs.cs
- TCEAdapterGenerator.cs
- DataGridTablesFactory.cs
- MimeMultiPart.cs
- TypeContext.cs
- WinEventHandler.cs
- SourceFileInfo.cs
- RadioButton.cs
- RadioButtonBaseAdapter.cs
- LocatorBase.cs
- TextProperties.cs
- ConditionCollection.cs
- Merger.cs
- ItemCollection.cs
- OptimalTextSource.cs
- RuntimeHandles.cs
- RecommendedAsConfigurableAttribute.cs
- SubMenuStyleCollectionEditor.cs