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
- RegexReplacement.cs
- DataGridCellsPresenter.cs
- SByteConverter.cs
- InputLangChangeEvent.cs
- SplashScreenNativeMethods.cs
- SyntaxCheck.cs
- FixedElement.cs
- VisualBasicSettingsHandler.cs
- complextypematerializer.cs
- Site.cs
- DebugTracing.cs
- FixedSchema.cs
- ListViewCommandEventArgs.cs
- RegexTree.cs
- ConfigXmlWhitespace.cs
- RunWorkerCompletedEventArgs.cs
- DataSvcMapFileSerializer.cs
- RemotingServices.cs
- DbConnectionPoolCounters.cs
- StaticDataManager.cs
- ToolStripRenderer.cs
- ContainerControl.cs
- CompModSwitches.cs
- DaylightTime.cs
- unsafeIndexingFilterStream.cs
- Select.cs
- RemotingConfigParser.cs
- MatchingStyle.cs
- ResXDataNode.cs
- SystemNetworkInterface.cs
- HandlerElement.cs
- Label.cs
- TextRangeBase.cs
- MouseBinding.cs
- StrongTypingException.cs
- DataGridViewCellCollection.cs
- XslException.cs
- XmlSubtreeReader.cs
- DetailsViewRow.cs
- MULTI_QI.cs
- TextBoxRenderer.cs
- EventLogPermission.cs
- SByteConverter.cs
- DataGridLength.cs
- FieldAccessException.cs
- DbgUtil.cs
- ListViewGroupItemCollection.cs
- DataGridViewAccessibleObject.cs
- Mappings.cs
- ConnectionStringsExpressionBuilder.cs
- OdbcEnvironment.cs
- DataPagerFieldCommandEventArgs.cs
- CapabilitiesAssignment.cs
- SelectionItemPattern.cs
- MergeLocalizationDirectives.cs
- ConfigurationProperty.cs
- SafeEventLogReadHandle.cs
- BookmarkNameHelper.cs
- Signature.cs
- ScrollableControl.cs
- ChannelManagerBase.cs
- AsyncDataRequest.cs
- CharacterBuffer.cs
- StringInfo.cs
- PropertyPushdownHelper.cs
- Terminate.cs
- HtmlMeta.cs
- XmlMembersMapping.cs
- SqlDependency.cs
- IgnoreSection.cs
- EntityCollection.cs
- ActiveXSite.cs
- UriWriter.cs
- ConfigXmlElement.cs
- AuthenticatedStream.cs
- ExpressionConverter.cs
- ExtendedProperty.cs
- DbResourceAllocator.cs
- Base64Encoder.cs
- DataProtection.cs
- RoutedEventHandlerInfo.cs
- DefaultMergeHelper.cs
- ManagedFilter.cs
- RevocationPoint.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- AutoResetEvent.cs
- IntSecurity.cs
- TableParagraph.cs
- XmlNamespaceMappingCollection.cs
- Asn1IntegerConverter.cs
- PixelFormat.cs
- namescope.cs
- RenderDataDrawingContext.cs
- NotifyInputEventArgs.cs
- ToolStripLocationCancelEventArgs.cs
- ProfilePropertyMetadata.cs
- AutoResizedEvent.cs
- SHA512Managed.cs
- ResetableIterator.cs
- MarkupCompilePass1.cs