Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SHA1.cs
- ScrollBarRenderer.cs
- CollectionView.cs
- TextEditorParagraphs.cs
- StaticFileHandler.cs
- TypeToken.cs
- MethodToken.cs
- SqlHelper.cs
- PageAsyncTaskManager.cs
- WpfGeneratedKnownTypes.cs
- ConnectionStringSettingsCollection.cs
- ListViewItemEventArgs.cs
- WorkflowDesignerMessageFilter.cs
- ReadingWritingEntityEventArgs.cs
- XmlWhitespace.cs
- StateDesigner.Layouts.cs
- ApplicationContext.cs
- CompiledQuery.cs
- WebPartDisplayModeCancelEventArgs.cs
- ObjectAssociationEndMapping.cs
- GregorianCalendar.cs
- SchemaDeclBase.cs
- TextRange.cs
- DataTableReader.cs
- Scripts.cs
- ConnectionPoint.cs
- ColorPalette.cs
- cookiecontainer.cs
- ViewBase.cs
- PaintEvent.cs
- ProfileGroupSettings.cs
- DataErrorValidationRule.cs
- SqlDataReader.cs
- HttpWebResponse.cs
- OutputCacheProfileCollection.cs
- ParameterSubsegment.cs
- PartitionResolver.cs
- GridViewColumnHeaderAutomationPeer.cs
- ColorTransformHelper.cs
- SqlTrackingService.cs
- WebPartDescriptionCollection.cs
- Cloud.cs
- HttpCacheParams.cs
- InternalBase.cs
- UIElement.cs
- DrawingImage.cs
- Simplifier.cs
- BitmapEffectRenderDataResource.cs
- CollectionViewGroup.cs
- ConnectionManagementElement.cs
- OleStrCAMarshaler.cs
- TextElementEditingBehaviorAttribute.cs
- DataGridViewRowsRemovedEventArgs.cs
- AddingNewEventArgs.cs
- DocumentXmlWriter.cs
- NetworkCredential.cs
- ConfigXmlWhitespace.cs
- MenuItemCollectionEditor.cs
- WebEvents.cs
- FullTextLine.cs
- ClientScriptManagerWrapper.cs
- ToolStripItemImageRenderEventArgs.cs
- UserControlBuildProvider.cs
- XmlILStorageConverter.cs
- SortableBindingList.cs
- UnaryNode.cs
- Util.cs
- TdsParserStateObject.cs
- _PooledStream.cs
- QilValidationVisitor.cs
- FSWPathEditor.cs
- WinFormsSecurity.cs
- CapacityStreamGeometryContext.cs
- WmlObjectListAdapter.cs
- SoapElementAttribute.cs
- TypeElement.cs
- DaylightTime.cs
- RequiredFieldValidator.cs
- RegionInfo.cs
- KeyNotFoundException.cs
- ContainerAction.cs
- _SslStream.cs
- CommandID.cs
- UIElement3DAutomationPeer.cs
- RegexCapture.cs
- FigureParagraph.cs
- FilterElement.cs
- LocationSectionRecord.cs
- PolygonHotSpot.cs
- SeekableMessageNavigator.cs
- Int32KeyFrameCollection.cs
- StringTraceRecord.cs
- ButtonBaseAutomationPeer.cs
- JournalEntryStack.cs
- Matrix3D.cs
- RSAOAEPKeyExchangeDeformatter.cs
- _SecureChannel.cs
- XmlSchemaAttributeGroupRef.cs
- ModuleConfigurationInfo.cs
- XslCompiledTransform.cs