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
- GenericEnumerator.cs
- AxisAngleRotation3D.cs
- BuildManagerHost.cs
- SqlConnectionHelper.cs
- OdbcHandle.cs
- EntityCommandDefinition.cs
- EntitySetRetriever.cs
- SqlProfileProvider.cs
- ConditionValidator.cs
- RootBrowserWindowProxy.cs
- WorkflowFileItem.cs
- XmlNotation.cs
- ConstraintConverter.cs
- SessionStateModule.cs
- GeneralTransform3DTo2DTo3D.cs
- FontStyles.cs
- COM2ColorConverter.cs
- _FtpControlStream.cs
- EncoderParameter.cs
- TogglePatternIdentifiers.cs
- Odbc32.cs
- XmlAggregates.cs
- Icon.cs
- TracingConnection.cs
- ViewStateModeByIdAttribute.cs
- ToolStripItemClickedEventArgs.cs
- EncodingNLS.cs
- QueryCacheManager.cs
- ComponentResourceKeyConverter.cs
- OptionalColumn.cs
- BamlResourceSerializer.cs
- Path.cs
- LocalIdKeyIdentifierClause.cs
- HtmlImage.cs
- TableRowGroup.cs
- hebrewshape.cs
- ContentPosition.cs
- ZeroOpNode.cs
- PrintPreviewDialog.cs
- BlockUIContainer.cs
- RelativeSource.cs
- GlobalAclOperationRequirement.cs
- FontFaceLayoutInfo.cs
- TextEffectCollection.cs
- MatchAttribute.cs
- AdPostCacheSubstitution.cs
- ModuleElement.cs
- ComEventsInfo.cs
- DataSourceProvider.cs
- GridViewCancelEditEventArgs.cs
- MethodAccessException.cs
- PrincipalPermission.cs
- Highlights.cs
- EditorZoneDesigner.cs
- XmlSerializerOperationBehavior.cs
- XmlWrappingReader.cs
- ExpandCollapseProviderWrapper.cs
- CounterCreationDataConverter.cs
- HyperLinkField.cs
- XPathParser.cs
- NotFiniteNumberException.cs
- TrackingLocation.cs
- ListSortDescriptionCollection.cs
- SchemaAttDef.cs
- GeometryGroup.cs
- DrawingContextDrawingContextWalker.cs
- BookmarkUndoUnit.cs
- StateRuntime.cs
- LoginCancelEventArgs.cs
- DbConnectionPoolGroup.cs
- JsonXmlDataContract.cs
- CompositeDuplexBindingElement.cs
- ByteAnimationBase.cs
- DynamicActivityTypeDescriptor.cs
- precedingsibling.cs
- RtfFormatStack.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- XhtmlBasicImageAdapter.cs
- AuthenticatedStream.cs
- DoubleCollectionValueSerializer.cs
- BamlCollectionHolder.cs
- DisplayToken.cs
- GroupLabel.cs
- WindowsTokenRoleProvider.cs
- DataColumnPropertyDescriptor.cs
- ListViewDesigner.cs
- EntityDataSourceDataSelectionPanel.cs
- ToolStripItemCollection.cs
- processwaithandle.cs
- UdpDuplexChannel.cs
- WebOperationContext.cs
- GroupQuery.cs
- ForwardPositionQuery.cs
- WebPartUserCapability.cs
- TextProviderWrapper.cs
- IndentedWriter.cs
- SqlParameterCollection.cs
- Header.cs
- CacheVirtualItemsEvent.cs
- WebPartEditVerb.cs