-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[NativeAOT] Thin locks #79519
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
[NativeAOT] Thin locks #79519
Changes from all commits
aaee546
2ddb01a
7a49ffc
700d437
cd5fc2a
7beea61
59610de
f809161
e3d4e87
46f28ed
16183e9
236410f
0eebcab
85dc071
77c1bec
867a8ee
b755737
6b557ec
bc54d49
0a78358
367acbb
43a354d
536492b
a96f618
a7256ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
EXTERN_C DECLSPEC_THREAD ThreadBuffer tls_CurrentThread; | ||
#ifdef _MSC_VER | ||
// a workaround to prevent tls_CurrentThread from becoming dynamically checked/initialized. | ||
|
||
EXTERN_C __declspec(selectany) __declspec(thread) ThreadBuffer tls_CurrentThread; | ||
#else | ||
EXTERN_C __thread ThreadBuffer tls_CurrentThread; | ||
|
||
#endif | ||
|
||
// static | ||
inline Thread * ThreadStore::RawGetCurrentThread() | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is just because we switched to SpinWait that is calibrated to 35 nsec.
Previous numbers were assumed in terms of pre-skylake "pause", or, simply put, were divided by 8 in the underlying APIs.
I also made it power of 2. It is more convenient.