Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Threading / LockCookie.cs / 1 / LockCookie.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: LockCookie ** ** ** Purpose: Defines the lock that implements ** single-writer/multiple-reader semantics ** ** ===========================================================*/ namespace System.Threading { using System; [System.Runtime.InteropServices.ComVisible(true)] public struct LockCookie { private int _dwFlags; private int _dwWriterSeqNum; private int _wReaderAndWriterLevel; private int _dwThreadID; public override int GetHashCode() { // review - [....]! return _dwFlags + _dwWriterSeqNum + _wReaderAndWriterLevel + _dwThreadID; } public override bool Equals(Object obj) { if (obj is LockCookie) return Equals((LockCookie)obj); else return false; } public bool Equals(LockCookie obj) { return obj._dwFlags == _dwFlags && obj._dwWriterSeqNum == _dwWriterSeqNum && obj._wReaderAndWriterLevel == _wReaderAndWriterLevel && obj._dwThreadID == _dwThreadID; } public static bool operator ==(LockCookie a, LockCookie b) { return a.Equals(b); } public static bool operator !=(LockCookie a, LockCookie b) { return !(a == b); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: LockCookie ** ** ** Purpose: Defines the lock that implements ** single-writer/multiple-reader semantics ** ** ===========================================================*/ namespace System.Threading { using System; [System.Runtime.InteropServices.ComVisible(true)] public struct LockCookie { private int _dwFlags; private int _dwWriterSeqNum; private int _wReaderAndWriterLevel; private int _dwThreadID; public override int GetHashCode() { // review - [....]! return _dwFlags + _dwWriterSeqNum + _wReaderAndWriterLevel + _dwThreadID; } public override bool Equals(Object obj) { if (obj is LockCookie) return Equals((LockCookie)obj); else return false; } public bool Equals(LockCookie obj) { return obj._dwFlags == _dwFlags && obj._dwWriterSeqNum == _dwWriterSeqNum && obj._wReaderAndWriterLevel == _wReaderAndWriterLevel && obj._dwThreadID == _dwThreadID; } public static bool operator ==(LockCookie a, LockCookie b) { return a.Equals(b); } public static bool operator !=(LockCookie a, LockCookie b) { return !(a == b); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LingerOption.cs
- Transform.cs
- Debug.cs
- DesignerCategoryAttribute.cs
- TimeSpan.cs
- DataException.cs
- WebPartDescriptionCollection.cs
- MarkupWriter.cs
- SplitterDesigner.cs
- Menu.cs
- XmlName.cs
- PackageDigitalSignature.cs
- XmlCDATASection.cs
- BinaryParser.cs
- GridItemProviderWrapper.cs
- LicenseContext.cs
- ClientUrlResolverWrapper.cs
- ZipIOExtraField.cs
- FixedSOMLineCollection.cs
- DesignerTransactionCloseEvent.cs
- FloatUtil.cs
- Hash.cs
- Panel.cs
- EncoderParameter.cs
- SafeRightsManagementQueryHandle.cs
- UInt32.cs
- LabelEditEvent.cs
- DataTableExtensions.cs
- SettingsAttributeDictionary.cs
- selecteditemcollection.cs
- StylusPointProperties.cs
- StringReader.cs
- WebPartConnectionsCloseVerb.cs
- ObjectDisposedException.cs
- StrongNamePublicKeyBlob.cs
- FontWeightConverter.cs
- DataGridViewButtonCell.cs
- IODescriptionAttribute.cs
- ProtectedProviderSettings.cs
- IQueryable.cs
- CaseInsensitiveComparer.cs
- _ListenerResponseStream.cs
- TextCharacters.cs
- MimeFormReflector.cs
- ResolveMatches11.cs
- ToolBarOverflowPanel.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- KeyInterop.cs
- DocumentReferenceCollection.cs
- UserControl.cs
- CryptoKeySecurity.cs
- BaseWebProxyFinder.cs
- RegionIterator.cs
- GridViewHeaderRowPresenter.cs
- ThrowHelper.cs
- NTAccount.cs
- HGlobalSafeHandle.cs
- ManagementNamedValueCollection.cs
- GregorianCalendar.cs
- PixelFormat.cs
- QueryComponents.cs
- TextParaLineResult.cs
- MgmtConfigurationRecord.cs
- MdiWindowListItemConverter.cs
- ComMethodElement.cs
- UnsafeNativeMethods.cs
- TypeInitializationException.cs
- MenuItem.cs
- SmtpLoginAuthenticationModule.cs
- AppDomainProtocolHandler.cs
- HtmlContainerControl.cs
- BufferCache.cs
- DataTableNewRowEvent.cs
- XhtmlBasicValidationSummaryAdapter.cs
- ClientRolePrincipal.cs
- DataAdapter.cs
- ListViewItem.cs
- UpdatePanel.cs
- XmlSchemaException.cs
- XPathBinder.cs
- PartBasedPackageProperties.cs
- DrawingVisual.cs
- SoapReflectionImporter.cs
- TransformerInfoCollection.cs
- CodeTypeReferenceExpression.cs
- NonBatchDirectoryCompiler.cs
- XmlSchemaAny.cs
- StreamGeometry.cs
- RegularExpressionValidator.cs
- UnknownBitmapEncoder.cs
- XPathSelfQuery.cs
- ExceptionRoutedEventArgs.cs
- ProcessHostServerConfig.cs
- TextMarkerSource.cs
- ZipIOExtraField.cs
- Delegate.cs
- DataObjectCopyingEventArgs.cs
- InvalidPropValue.cs
- DataRowExtensions.cs
- StyleHelper.cs