Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LockCookie.cs
Go to the documentation of this file.
2
3namespace System.Threading;
4
5public struct LockCookie
6{
8
9 internal ushort _readerLevel;
10
11 internal ushort _writerLevel;
12
13 internal int _threadID;
14
15 public override int GetHashCode()
16 {
17 return (int)(_flags + _readerLevel + _writerLevel + _threadID);
18 }
19
20 public override bool Equals([NotNullWhen(true)] object? obj)
21 {
22 if (obj is LockCookie)
23 {
24 return Equals((LockCookie)obj);
25 }
26 return false;
27 }
28
29 public bool Equals(LockCookie obj)
30 {
31 if (_flags == obj._flags && _readerLevel == obj._readerLevel && _writerLevel == obj._writerLevel)
32 {
33 return _threadID == obj._threadID;
34 }
35 return false;
36 }
37
38 public static bool operator ==(LockCookie a, LockCookie b)
39 {
40 return a.Equals(b);
41 }
42
43 public static bool operator !=(LockCookie a, LockCookie b)
44 {
45 return !(a == b);
46 }
47}
override bool Equals([NotNullWhen(true)] object? obj)
Definition LockCookie.cs:20
LockCookieFlags _flags
Definition LockCookie.cs:7
bool Equals(LockCookie obj)
Definition LockCookie.cs:29
static bool operator==(LockCookie a, LockCookie b)
Definition LockCookie.cs:38
override int GetHashCode()
Definition LockCookie.cs:15
static bool operator!=(LockCookie a, LockCookie b)
Definition LockCookie.cs:43