Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- HttpServerVarsCollection.cs
- PopupRoot.cs
- AppDomainEvidenceFactory.cs
- TypeNameParser.cs
- ChannelCredentials.cs
- Signature.cs
- SelectionService.cs
- StringBlob.cs
- _NegotiateClient.cs
- Page.cs
- Parameter.cs
- BufferedWebEventProvider.cs
- Hyperlink.cs
- DesignerTransaction.cs
- TransformProviderWrapper.cs
- ActiveXContainer.cs
- ListViewDeleteEventArgs.cs
- CodeConditionStatement.cs
- DropShadowBitmapEffect.cs
- SerializationObjectManager.cs
- ScriptServiceAttribute.cs
- VisualStyleTypesAndProperties.cs
- webproxy.cs
- WpfSharedXamlSchemaContext.cs
- LocationReferenceValue.cs
- MsmqAppDomainProtocolHandler.cs
- JsonReaderDelegator.cs
- BinarySerializer.cs
- PagesChangedEventArgs.cs
- ConversionContext.cs
- MessagePartDescription.cs
- WeakReferenceList.cs
- LiteralLink.cs
- TextElementEditingBehaviorAttribute.cs
- LZCodec.cs
- ClientSponsor.cs
- WebPartManagerInternals.cs
- EventPrivateKey.cs
- DBSqlParser.cs
- IdnElement.cs
- ExceptionHandlersDesigner.cs
- SetUserLanguageRequest.cs
- Variable.cs
- SerializationFieldInfo.cs
- InvalidDataException.cs
- VirtualizingStackPanel.cs
- JapaneseLunisolarCalendar.cs
- AssemblyUtil.cs
- FilterException.cs
- SystemMulticastIPAddressInformation.cs
- ThreadStartException.cs
- ImageField.cs
- SerializerWriterEventHandlers.cs
- FixedNode.cs
- KeySplineConverter.cs
- ModuleBuilderData.cs
- TriState.cs
- CompositeActivityCodeGenerator.cs
- CacheDependency.cs
- ToolStripActionList.cs
- RecipientInfo.cs
- DataViewSetting.cs
- ToolStripItemTextRenderEventArgs.cs
- ServiceContractListItem.cs
- CharacterShapingProperties.cs
- DefaultPropertyAttribute.cs
- StreamUpdate.cs
- CacheModeConverter.cs
- mediaclock.cs
- SafeNativeMethods.cs
- SimpleExpression.cs
- Tablet.cs
- PointLight.cs
- DataControlFieldHeaderCell.cs
- ResourceDefaultValueAttribute.cs
- CommandPlan.cs
- AppSecurityManager.cs
- CommandID.cs
- Icon.cs
- TransportSecurityBindingElement.cs
- Transform3D.cs
- XhtmlConformanceSection.cs
- XhtmlBasicObjectListAdapter.cs
- Transform.cs
- CompareInfo.cs
- FilterableAttribute.cs
- MarkedHighlightComponent.cs
- ApplyImportsAction.cs
- Delegate.cs
- Schedule.cs
- _ListenerRequestStream.cs
- QuotedPrintableStream.cs
- FixedPosition.cs
- SpellerStatusTable.cs
- ElementsClipboardData.cs
- DataSourceBooleanViewSchemaConverter.cs
- RelationshipDetailsRow.cs
- ThaiBuddhistCalendar.cs
- NotCondition.cs
- RegistrationServices.cs