Code:
/ FX-1434 / FX-1434 / 1.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
- WpfPayload.cs
- PropertyMetadata.cs
- StateBag.cs
- GrabHandleGlyph.cs
- MonitoringDescriptionAttribute.cs
- Point.cs
- CryptoStream.cs
- Queue.cs
- PaginationProgressEventArgs.cs
- PasswordRecovery.cs
- ErrorStyle.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ExitEventArgs.cs
- SafeHandle.cs
- DSGeneratorProblem.cs
- XmlLoader.cs
- QueryableDataSourceEditData.cs
- Rotation3DAnimation.cs
- XmlArrayAttribute.cs
- ByteFacetDescriptionElement.cs
- ApplicationFileParser.cs
- WriterOutput.cs
- Preprocessor.cs
- PolyLineSegment.cs
- ISessionStateStore.cs
- Triplet.cs
- CompilationRelaxations.cs
- UnsafeNativeMethods.cs
- WebPartEditVerb.cs
- Ref.cs
- CapiSymmetricAlgorithm.cs
- HtmlElementCollection.cs
- TypeLibConverter.cs
- WebPartDescriptionCollection.cs
- DataSourceExpressionCollection.cs
- UdpUtility.cs
- HeaderUtility.cs
- BackStopAuthenticationModule.cs
- MenuItemStyle.cs
- EventRoute.cs
- WebSysDescriptionAttribute.cs
- WebRequestModuleElement.cs
- AssemblyNameProxy.cs
- KeyGesture.cs
- ButtonChrome.cs
- BufferedReadStream.cs
- DesignerView.Commands.cs
- RuntimeWrappedException.cs
- ListItemCollection.cs
- TrustManagerPromptUI.cs
- ReadWriteObjectLock.cs
- RequestBringIntoViewEventArgs.cs
- RequiredFieldValidator.cs
- SQlBooleanStorage.cs
- MimePart.cs
- SizeAnimationBase.cs
- BookmarkNameHelper.cs
- TextSerializer.cs
- DbConnectionHelper.cs
- FontWeightConverter.cs
- XmlSerializer.cs
- ExpressionEditorAttribute.cs
- Int32Converter.cs
- TextServicesDisplayAttributePropertyRanges.cs
- PtsHost.cs
- BitmapPalette.cs
- Vector3DValueSerializer.cs
- TemplateXamlParser.cs
- ConnectionPoolManager.cs
- SiteMembershipCondition.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- PixelShader.cs
- CroppedBitmap.cs
- XmlQuerySequence.cs
- DependencyObjectType.cs
- InvokeBase.cs
- WebHttpBindingElement.cs
- DataPointer.cs
- AdPostCacheSubstitution.cs
- CharUnicodeInfo.cs
- ExpressionBindingsDialog.cs
- _NestedSingleAsyncResult.cs
- StateDesigner.Layouts.cs
- SafeEventLogWriteHandle.cs
- AuthenticationSection.cs
- TcpSocketManager.cs
- HtmlFormWrapper.cs
- Triangle.cs
- ResourceDescriptionAttribute.cs
- PropertyGridDesigner.cs
- WebMessageFormatHelper.cs
- BaseServiceProvider.cs
- Dump.cs
- ImmutableAssemblyCacheEntry.cs
- SimplePropertyEntry.cs
- HuffmanTree.cs
- Util.cs
- ConnectionDemuxer.cs
- TextPatternIdentifiers.cs
- QuaternionConverter.cs