Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Threading / LockCookie.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PersonalizationProviderCollection.cs
- PropertyChangedEventArgs.cs
- AutoResizedEvent.cs
- HitTestParameters3D.cs
- OpacityConverter.cs
- DispatcherHookEventArgs.cs
- TcpConnectionPoolSettingsElement.cs
- DataGridViewTextBoxEditingControl.cs
- DetailsViewDeletedEventArgs.cs
- LogicalTreeHelper.cs
- HttpModulesSection.cs
- ArcSegment.cs
- Rules.cs
- RelationshipManager.cs
- HtmlGenericControl.cs
- AttachedPropertyMethodSelector.cs
- DataSourceIDConverter.cs
- Point4DValueSerializer.cs
- GeneralTransform3D.cs
- EntityEntry.cs
- HierarchicalDataSourceDesigner.cs
- RemotingConfigParser.cs
- ThicknessAnimation.cs
- Instrumentation.cs
- DocumentDesigner.cs
- DataSourceSelectArguments.cs
- MetadataPropertyAttribute.cs
- RunWorkerCompletedEventArgs.cs
- OdbcErrorCollection.cs
- ListViewItem.cs
- ButtonFieldBase.cs
- XmlMemberMapping.cs
- CustomPopupPlacement.cs
- DataPager.cs
- SafeBuffer.cs
- AxisAngleRotation3D.cs
- ErrorFormatterPage.cs
- StorageFunctionMapping.cs
- OpenTypeLayoutCache.cs
- ImpersonateTokenRef.cs
- PropertyValueUIItem.cs
- Win32PrintDialog.cs
- SchemaTypeEmitter.cs
- ProcessInputEventArgs.cs
- DoubleAnimationBase.cs
- StagingAreaInputItem.cs
- StringBuilder.cs
- PackageRelationship.cs
- AttributeData.cs
- AudioSignalProblemOccurredEventArgs.cs
- SqlNamer.cs
- XamlSerializationHelper.cs
- Timer.cs
- BinaryConverter.cs
- RoutedEventConverter.cs
- DesignerActionUIStateChangeEventArgs.cs
- KeyEvent.cs
- NamespaceTable.cs
- URLAttribute.cs
- CodeCatchClause.cs
- ToggleProviderWrapper.cs
- GraphicsContext.cs
- ContextProperty.cs
- SchemaAttDef.cs
- StickyNoteHelper.cs
- DeferredSelectedIndexReference.cs
- ControlParameter.cs
- UserPreferenceChangingEventArgs.cs
- SqlBulkCopy.cs
- XPathNodePointer.cs
- RenderContext.cs
- ParameterModifier.cs
- PageAdapter.cs
- TextTreeInsertElementUndoUnit.cs
- ViewGenerator.cs
- TreeNodeBinding.cs
- CollectionView.cs
- WindowsTokenRoleProvider.cs
- SqlBuffer.cs
- XPathDocumentIterator.cs
- GenericWebPart.cs
- LinearGradientBrush.cs
- ImageCodecInfoPrivate.cs
- BinaryNode.cs
- ProtocolsSection.cs
- TextBox.cs
- OrderByExpression.cs
- AdornerLayer.cs
- ToolboxBitmapAttribute.cs
- PartManifestEntry.cs
- Wizard.cs
- CodeTypeConstructor.cs
- Container.cs
- DefaultSection.cs
- ReadOnlyDictionary.cs
- LinkButton.cs
- XMLUtil.cs
- AppDomainShutdownMonitor.cs
- WebPartsPersonalization.cs
- Msec.cs