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
- MailDefinition.cs
- DataGridHeaderBorder.cs
- OLEDB_Util.cs
- HttpHeaderCollection.cs
- SqlTriggerContext.cs
- XmlCharacterData.cs
- WindowAutomationPeer.cs
- errorpatternmatcher.cs
- XmlDataImplementation.cs
- DrawItemEvent.cs
- StaticExtensionConverter.cs
- SpeechDetectedEventArgs.cs
- MD5Cng.cs
- FlowLayout.cs
- TypeBrowser.xaml.cs
- SortAction.cs
- InvalidOperationException.cs
- ServerValidateEventArgs.cs
- DataTableClearEvent.cs
- XmlSchemaAnnotation.cs
- Ipv6Element.cs
- InputQueue.cs
- LogExtent.cs
- MdiWindowListStrip.cs
- ThousandthOfEmRealDoubles.cs
- DeviceContext2.cs
- UITypeEditors.cs
- ObjectDataProvider.cs
- control.ime.cs
- BinaryQueryOperator.cs
- DateTimeSerializationSection.cs
- CompiledIdentityConstraint.cs
- OdbcTransaction.cs
- UrlAuthFailedErrorFormatter.cs
- WorkflowElementDialog.cs
- CompiledQueryCacheKey.cs
- PointLightBase.cs
- CompilerScopeManager.cs
- HttpDebugHandler.cs
- ParseNumbers.cs
- SchemaCompiler.cs
- XPathMessageFilterElementComparer.cs
- ToReply.cs
- ListBindableAttribute.cs
- IDQuery.cs
- ActivationArguments.cs
- ForwardPositionQuery.cs
- JsonReader.cs
- EncodedStreamFactory.cs
- CannotUnloadAppDomainException.cs
- SchemaImporterExtensionElement.cs
- AssociationSetEnd.cs
- MonikerBuilder.cs
- AuthenticationServiceManager.cs
- HttpModuleActionCollection.cs
- TypeSchema.cs
- PersonalizableAttribute.cs
- SendingRequestEventArgs.cs
- JournalEntryStack.cs
- SoapReflector.cs
- DocumentPage.cs
- XmlHierarchyData.cs
- TreeViewBindingsEditor.cs
- ThemeableAttribute.cs
- LiteralControl.cs
- DateTimeFormatInfoScanner.cs
- AlternateView.cs
- OrderedDictionary.cs
- SuppressMessageAttribute.cs
- ConnectionManagementElement.cs
- EmbossBitmapEffect.cs
- AdornedElementPlaceholder.cs
- PersonalizablePropertyEntry.cs
- XPathBuilder.cs
- ThicknessAnimationUsingKeyFrames.cs
- SHA512Managed.cs
- PageThemeCodeDomTreeGenerator.cs
- ReferentialConstraintRoleElement.cs
- WindowsToolbarItemAsMenuItem.cs
- Opcode.cs
- HttpClientChannel.cs
- PriorityRange.cs
- ValueQuery.cs
- PerformanceCounterLib.cs
- CodeMemberEvent.cs
- MaskedTextProvider.cs
- DeviceContexts.cs
- ArraySegment.cs
- XomlCompilerResults.cs
- SqlDataSourceFilteringEventArgs.cs
- AnimatedTypeHelpers.cs
- RoutedPropertyChangedEventArgs.cs
- SamlAuthenticationStatement.cs
- IndentedWriter.cs
- FixedSOMLineRanges.cs
- SystemSounds.cs
- CDSCollectionETWBCLProvider.cs
- RealProxy.cs
- SqlClientWrapperSmiStream.cs
- LinqToSqlWrapper.cs