Skip to content

Commit b59d9f1

Browse files
SBLK_MASK_LOCK_THREADID allow tid up to 65535 (#88772)
* SBLK_MASK_LOCK_THREADID allow tid up to 65535 * copy comment from NativeAOT ObjectHeader.cs --------- Co-authored-by: dickens <dickens.tam@pulsartradingcap.com>
1 parent 0ccbbe7 commit b59d9f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/coreclr/vm/syncblk.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ typedef DPTR(EnCSyncBlockInfo) PTR_EnCSyncBlockInfo;
9999
#define BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX 0x08000000
100100

101101
// if BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX is clear, the rest of the header dword is laid out as follows:
102-
// - lower ten bits (bits 0 thru 9) is thread id used for the thin locks
102+
// - lower sixteen bits (bits 0 thru 15) is thread id used for the thin locks
103103
// value is zero if no thread is holding the lock
104-
// - following six bits (bits 10 thru 15) is recursion level used for the thin locks
104+
// - following six bits (bits 16 thru 21) is recursion level used for the thin locks
105105
// value is zero if lock is not taken or only taken once by the same thread
106-
#define SBLK_MASK_LOCK_THREADID 0x000003FF // special value of 0 + 1023 thread ids
107-
#define SBLK_MASK_LOCK_RECLEVEL 0x0000FC00 // 64 recursion levels
108-
#define SBLK_LOCK_RECLEVEL_INC 0x00000400 // each level is this much higher than the previous one
109-
#define SBLK_RECLEVEL_SHIFT 10 // shift right this much to get recursion level
106+
#define SBLK_MASK_LOCK_THREADID 0x0000FFFF // special value of 0 + 65535 thread ids
107+
#define SBLK_MASK_LOCK_RECLEVEL 0x003F0000 // 64 recursion levels
108+
#define SBLK_LOCK_RECLEVEL_INC 0x00010000 // each level is this much higher than the previous one
109+
#define SBLK_RECLEVEL_SHIFT 16 // shift right this much to get recursion level
110110

111111
// add more bits here... (adjusting the following mask to make room)
112112

0 commit comments

Comments
 (0)