Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBLK_MASK_LOCK_THREADID allow tid up to 65535 #88772

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/coreclr/vm/syncblk.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ typedef DPTR(EnCSyncBlockInfo) PTR_EnCSyncBlockInfo;
#define BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX 0x08000000

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

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

Expand Down