-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Change Mutex to use SRWLock on Windows. #20367
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
Conversation
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
Can you add a comment in the code as well explaining why one might expect us to use a Other than that though r=me, nice find! |
91efcdc
to
6b21ee0
Compare
Comment added and rebased. |
We already use the unfair |
I'd be fine with holding off on this PR until a design consensus is made regarding the fairness of the locks that Rust provides. In the meantime someone can add a simple flag/semaphore/whatever to Mutex to fix the recursive locking issue. |
When stabilizing the The current plan is to definitely allow for these primitives to grow in the future with perhaps a new |
54cc177
to
b939b89
Compare
Needs a rebase |
Rebased |
@retep998 needs a rebase |
Rebased. |
Signed-off-by: Peter Atashian <retep998@gmail.com>
Rebased again... |
Also adjusted some of the FFI definitions because apparently they don't use the long pointer prefix. Gives a free performance boost because `SRWLock` is several times faster than `CriticalRegion` on every Windows system tested. Fixes #19962
Also adjusted some of the FFI definitions because apparently they don't use the long pointer prefix.
Gives a free performance boost because
SRWLock
is several times faster thanCriticalRegion
on every Windows system tested.Fixes #19962