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
- CalloutQueueItem.cs
- EncodingStreamWrapper.cs
- TableLayoutStyleCollection.cs
- Object.cs
- PositiveTimeSpanValidatorAttribute.cs
- DefaultPrintController.cs
- BaseDataBoundControl.cs
- Query.cs
- HttpRawResponse.cs
- FunctionDescription.cs
- WebHttpEndpointElement.cs
- XmlSchemaSequence.cs
- PrimitiveRenderer.cs
- Zone.cs
- WebHttpEndpoint.cs
- TextPointerBase.cs
- CursorInteropHelper.cs
- WebServiceData.cs
- SetMemberBinder.cs
- TreeViewEvent.cs
- SchemaElementDecl.cs
- AuthenticateEventArgs.cs
- XmlDocument.cs
- FrameDimension.cs
- ColorTransformHelper.cs
- TextUtf8RawTextWriter.cs
- ApplicationBuildProvider.cs
- SessionParameter.cs
- TemplateControlBuildProvider.cs
- VerificationException.cs
- MemoryResponseElement.cs
- TypeNameParser.cs
- ToolCreatedEventArgs.cs
- SecureUICommand.cs
- Message.cs
- ThemeDictionaryExtension.cs
- URLEditor.cs
- SoapTypeAttribute.cs
- TrustLevelCollection.cs
- InputScopeConverter.cs
- ChangeDirector.cs
- ScalarConstant.cs
- TrustManagerPromptUI.cs
- ObfuscationAttribute.cs
- FormsAuthenticationModule.cs
- PropertyItemInternal.cs
- Point3DAnimationBase.cs
- ProfileSection.cs
- ActivationArguments.cs
- _SingleItemRequestCache.cs
- CodeComment.cs
- ToolStripDropDownMenu.cs
- CqlIdentifiers.cs
- CFStream.cs
- ListViewContainer.cs
- EntitySetBase.cs
- Path.cs
- WindowExtensionMethods.cs
- TableParagraph.cs
- MarginsConverter.cs
- AutomationElementIdentifiers.cs
- RadioButtonList.cs
- MenuItem.cs
- ObjectDataSourceDisposingEventArgs.cs
- KeyedCollection.cs
- DataColumnPropertyDescriptor.cs
- PermissionSetTriple.cs
- DataGridBoolColumn.cs
- BindingList.cs
- ZipPackage.cs
- SafeEventHandle.cs
- CurrencyWrapper.cs
- MetadataArtifactLoader.cs
- DocumentOrderComparer.cs
- JapaneseLunisolarCalendar.cs
- GenericTextProperties.cs
- PerformanceCounterManager.cs
- EventLogPermission.cs
- SQLCharsStorage.cs
- ContentOperations.cs
- BitmapEffectrendercontext.cs
- XmlUtil.cs
- DataBoundControlHelper.cs
- QueryException.cs
- JournalEntryListConverter.cs
- LinkClickEvent.cs
- PrintPreviewControl.cs
- EnvironmentPermission.cs
- GenericParameterDataContract.cs
- WindowCollection.cs
- ExpressionPrefixAttribute.cs
- DataBoundControl.cs
- ListViewInsertEventArgs.cs
- IFlowDocumentViewer.cs
- ListenerConstants.cs
- TemplateModeChangedEventArgs.cs
- UniqueIdentifierService.cs
- ADConnectionHelper.cs
- VisualStyleElement.cs
- CompilationSection.cs