Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- NativeMethods.cs
- PeerTransportListenAddressValidator.cs
- ContentFileHelper.cs
- Currency.cs
- Panel.cs
- ImageCodecInfoPrivate.cs
- HttpHandlerActionCollection.cs
- TokenBasedSet.cs
- ImageKeyConverter.cs
- Listbox.cs
- SoapConverter.cs
- ListItemParagraph.cs
- FixedDocumentPaginator.cs
- QilStrConcat.cs
- ValidatedControlConverter.cs
- OleDbCommand.cs
- SRDisplayNameAttribute.cs
- TableCellCollection.cs
- EtwTrace.cs
- Root.cs
- BadImageFormatException.cs
- InitializationEventAttribute.cs
- RepeaterCommandEventArgs.cs
- ProfessionalColorTable.cs
- DefaultTextStore.cs
- NameScope.cs
- GenericEnumConverter.cs
- MimeTypeMapper.cs
- SchemaAttDef.cs
- ApplicationInfo.cs
- ConfigurationConverterBase.cs
- PagePropertiesChangingEventArgs.cs
- MILUtilities.cs
- CalendarDay.cs
- SoapMessage.cs
- TableLayoutPanel.cs
- EventDescriptorCollection.cs
- RootProfilePropertySettingsCollection.cs
- XPathSingletonIterator.cs
- SystemIcons.cs
- TraceXPathNavigator.cs
- CodeDelegateCreateExpression.cs
- MetafileHeader.cs
- ShapingEngine.cs
- IntSecurity.cs
- PlanCompiler.cs
- ContractAdapter.cs
- NavigationPropertySingletonExpression.cs
- NumericExpr.cs
- CodeObject.cs
- OSFeature.cs
- StreamWriter.cs
- IISUnsafeMethods.cs
- TextParaClient.cs
- FileNotFoundException.cs
- RightsManagementPermission.cs
- PatternMatchRules.cs
- HelpEvent.cs
- GridViewRowCollection.cs
- XmlSchemas.cs
- XmlValueConverter.cs
- KeyProperty.cs
- Msec.cs
- CatalogPartCollection.cs
- DataControlCommands.cs
- WinFormsUtils.cs
- UnsafeMethods.cs
- Freezable.cs
- Claim.cs
- CustomErrorsSection.cs
- EdmToObjectNamespaceMap.cs
- XPathException.cs
- CompositeScriptReference.cs
- UIElementHelper.cs
- ParenthesizePropertyNameAttribute.cs
- PartitionResolver.cs
- SafeProcessHandle.cs
- X509SubjectKeyIdentifierClause.cs
- RelationshipWrapper.cs
- CodeNamespaceCollection.cs
- RelationshipManager.cs
- EditorPart.cs
- CompareValidator.cs
- PageContentAsyncResult.cs
- ImageDrawing.cs
- DataControlExtensions.cs
- PropertyChangeTracker.cs
- CaseInsensitiveHashCodeProvider.cs
- SHA384Managed.cs
- CreateUserWizard.cs
- ProcessHost.cs
- ReturnValue.cs
- MatrixStack.cs
- ActivityBindForm.Designer.cs
- DeleteMemberBinder.cs
- NotFiniteNumberException.cs
- RoleManagerSection.cs
- BindingSource.cs
- DesignSurfaceEvent.cs
- TailCallAnalyzer.cs